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

Popular posts from this blog

c# - Roxy file manager in MVC doesn't accept session path -

php - proc_open Too many open files in long running Symfony Console app -

c# - Show a huge number of data in DevExpress GridView -