JSFiddle - React, Tailwind, and code Playground

by Nick Craver

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/dot-luv/jquery-ui.css">
<table>
    <tr>
<td>
   <div class=checkboxes>
      <LABEL style="white-space: nowrap;">
      <INPUT type="checkbox" name="user_registered" class="checkbox1" value="14"    >
      </LABEL><BR>                  
      <LABEL style="white-space: nowrap;">
      <INPUT type="checkbox" name="user_registered" class="checkbox2"  value="12"   >
   </div>
</td>
<td> </td>
</tr>
<tr>
<td>
   <div class=checkboxes>
      <LABEL style="white-space: nowrap;">
      <INPUT type="checkbox" name="user_registered" class="checkbox1" value="24"    >
      </LABEL><BR>                  
      <LABEL style="white-space: nowrap;">
      <INPUT type="checkbox" name="user_registered" class="checkbox2"  value="22"   >
   </div>
</td>
<td> </td>
</tr>
</table>

JavaScript

$("div.checkboxes").each(function() {
    var total = 0;
    $(this).find(":checkbox").each(function() {
        total += parseInt(this.value, 10);
    });
    $(this).parent().next().text(total);
});