title: jquery calculate html values next to checked checkboxes
body: <p>My head is not thinking right today. Could any of you help? =)
  Only checked int values in second column need to be calculated and alerted in sum.</p>
  
  <pre><code>&lt;table width="100%"&gt;
    &lt;tr&gt;&lt;td&gt;Product Name&lt;/td&gt;&lt;td&gt;Price $&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;&lt;input type="checkbox"&gt; Product 1&lt;/td&gt;&lt;td&gt;200&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;&lt;input type="checkbox"&gt; Product 2&lt;/td&gt;&lt;td&gt;300&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
    $('input').change(function() {
      var sum = 0;
      $("input:checked").each(function(){
        sum += parseInt($("input:checked").closest('td').next().html());
      });
      alert(sum);
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>Thanks.</p>