javascript - Calculate sum of values -
I'm trying to get some values in jQuery. I do this
var sum = 0; $ ("Total") Text (zodiac + = parsint ($ ("numbers."). Text (), 10));
But that is not making the amount I have tried the following which is not working?
var sum = 0; $ ("Total") ParseInt (sum + = parseInt ($ (". Number"). Text (), 10));
How can I calculate this amount?
Demo:
To sum up the values you have to Need to be repeated. Issue
element:
var sum = 0; $ ('Number'). Each (function () {sum + = parseInt ($. Text (this), 10);}); $ ('Total') text (sum).
Demo:
Comments
Post a Comment