I found [this][1], rather difficult, javascript example online and I\'ve implemented it with success in my website.
However, I would like to get the result of, in th
Well, if you have assigned ID's to text inputs, for example: , then you can call it with document.getElementById('my_input').value.
So:
Naturally, that is a very basic script, it doesn't check to make sure the entered values are numbers. We have to convert the fields into integers, otherwise they'll be strings (so 2+2 would equal 22). When the button is clicked, the function is called, which makes a variable for each input box, converts them to ints, adds them, and outputs our sum.