<form onsubmit="return false" oninput="o.value = a.valueAsNumber + b.valueAsNumber"> <label for="a"> Number one </label> <input id="a" type="number" step="any"> + <label for="b"> Number two </label> <input id="b" type="number" step="any"> <br> = <output id="o" for="a b"></output></form>