I have two input fields, see here.
When I add the values (1 and 1), the output is not 2, but 11, why?
I have two input fields, see here.
When I add the values (1 and 1), the output is not 2, but 11, why?
Looks like .value is making x and y evaluate to strings, not integers. You could use the pareseInt() function to convert these to integers before adding them together.
parseInt() example usage: https://www.w3schools.com/jsref/jsref_parseint.asp