I want to add some HTML elements that have the same class name.
So, the code will be like this with jQuery.
$(\".force\").each(function (){ a +=
Don't want a global?
(function() { var a = 0; $('.force').each(function (){ a += parseInt($(this).text()); }); $('#total_forces').text(a); })();