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


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).)

solved JavaScript function to add two numbers is not working right