I have the following code in a loop reading the contents of a folder:
<div class="oddrow">
<span class="title">1 - 1215 - Magna Carta</span><br/>
<span class="size">size: 229.1 MB</span>
<input name="1215 - Magna Carta" type="checkbox">
<div>
When the checkbox gets checked I want to have the sizes of each record added up in a separate div:
<div id="total>total = </div>
How can I do this?
As shane said, it would be better to save the plain number in an attribute. If that’s not a possibility you could still do it like that:
Demo:
http://jsfiddle.net/bGjP4/
Here’s how you could save it as value in the checkboxes: