[Solved] JavaScript function to add two numbers is not working right

[ad_1]

HTML DOM element properties are always strings. You need to convert them to numbers in your usage.

parseInt(form.resistance.value);
parseFloat(form.resistance.value);
+form.resistance.value;

(Any of the three will work; I prefer the first two (use parseInt unless you’re looking for a float).)

[ad_2]

solved JavaScript function to add two numbers is not working right