I’ve an html page which has many dynamically created input boxes. The number of text boxes vary each time.
I want to calculate the sum of the numbers the user has entered, and disply it. When the user delete one number the sum should auto calculate.
How can i do it with javascript?
Thanks
In jQuery something like this should work with a few assumptions:
The assumptions being that your input fields all have the class ‘toAdd’ and that your final input field has an ID of ‘total’.
In pure JS: