i get some question how to make if checkbox with id=’paysms’ is cheked , raise all element’s sum with id=’value’ , else default value.
here is the code.
<table class='table'>
<tr>
<th width='80%'>some things</th>
<th width='20%'>price (usd)</th>
</tr>
<tr>
<td width='80%'>thing1</td>
<td width='20%' id='value'>1.00</td>
</tr>
<tr>
<td width='80%'>thing2</td>
<td width='20%' id='value'>2.00</td>
</tr>
<tr>
<td width='80%'>thing3</td>
<td width='20%' id='value'>3.00</td>
</tr>
<tr>
<td width='80%'>thing4</td>
<td width='20%' id='value'>15.00</td>
</tr>
<tr>
<td width='80%' style='border: none; background: none;'></td>
<td width='20%'><label><input id='paysms' type='checkbox'> sms</label></td>
</tr>
</table>
undefined’s answer doesn’t seem to do exactly what you wanted (from what I understand). I think you get the point by now that IDs must be unique, so heres the javascript:
and fiddle: http://jsfiddle.net/EwEZK/3/
It would need modification if you wanted to have decimal values other than .00, however.