I have two textboxes Num1 and Num2 and another textbox Sum having the value 10.
Num1
Num2
Sum
10
How can I do this wherein if the user
function addNums() { var num1 = parseInt(document.getElementById('Num1').value,10); var num2 = parseInt(document.getElementById('Num2').value,10) document.getElementById('Sum').value = (num1 + num2).toString(); }
There are other ways to reference the form items, but this one works.