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 +=
You can use $(".force").length, it returns the number of elements in the jQuery object.
jQuery API