I have input box and has a id with value of the following
x=12
y=12
and when it display the sum of two it shows '1212' . Looks like I did was to add the string not the value. How do you do proper mathematical calculation
x=12
y=12
and when it display the sum of two it shows '1212' . Looks like I did was to add the string not the value. How do you do proper mathematical calculation
Code:
alert((document.getElementById('x').value)+
(document.getElementById('y').value));
Comment