My question is simple let's say you have multiple <span>
elements like this
<span class="hi">10,000</span>
<span class="hi">20,000</span>
<span class="hi">40,000</span>
<span class="hi">500,000</span>
How do you get each number content inside the span tag, strip the commas away and add the numbers get the answer and add commas, cause I can't seem to figure out a way to do this.
This is what I want to achieve
//data would be gotten from Span tag with class HI
<script>
var addthevalue = 10000+20000+40000+500000;
$(#theans).html(addthevalue);
</script>
<div id=theans></div>