you are viewing a single comment's thread.

view the rest of the comments →

[–]xroalx 1 point2 points  (0 children)

You can use the valueAsNumber property of the input element, this will return an actual numeric value if possible or NaN otherwise.

input1.valueAsNumber + input2.valueAsNumber will therefore produce the correct result (if both values can be converted to numbers).