title: How to use Jquery to check checkbox states and do something based on conditions?
body: <p>Here is my setup.</p>
  
  <pre><code>&lt;input type="checkbox" name="item1" value="100" class="100" /&gt;
  &lt;input type="checkbox" name="item2" value="200" class="200" /&gt;
  &lt;input type="checkbox" name="item3" value="300" class="300" /&gt;
  
  &lt;p&gt;$0.00&lt;/p&gt;
  </code></pre>
  
  <p>The criteria I need is:
  change P tag to the amount selected in the checkbox
  if more than 1 checkbox is checked, add the amount together and display in P tag
  if 1 or more checkbox is unchecked, subtract the amount and display in P tag
  if none is selected or all of them are unchecked, display ZERO in the P tag.</p>
  
  <p>I only have this so far but obviously it only displays the price of that selected box and doesn't add nor does it remove when I uncheck the box.</p>
  
  <pre><code>$("input[type=checkbox]").click(function() {
  var amount = $(this).attr("class");
  $("p").html("$"+amount);
  });
  </code></pre>
  
  <p>Any help appreciated!</p>