title: jquery check/uncheck list of checkboxes
body: <p>Since upgrading to jquery 1.9 my script stopped working for checking/unchecking checkboxes.</p>
  
  <p>I have a main check box that controls selecting/checking a list of checkboxes in a table. After upgrading to new jquery version only initially clicking "Check all" checkboxes get selected. Clicking the second time "Check all" causes checkboxes to uncheck, BUT doing "Check all" click after 2 clicks table checkboxes cease to work anymore.</p>
  
  <p><img src="https://i.stack.imgur.com/vyrTB.png" alt="enter image description here"></p>
  
  <p>script:</p>
  
  <pre><code>    $("#itemsList .checkall").on("click", function () {
          $(".checkbox").attr("checked", $(this).is(':checked'));
      });
  </code></pre>
  
  <p>also tried this:</p>
  
  <pre><code>    $("#itemsList .checkall").click(function () {
          $(".checkbox").attr("checked", $(this).is(':checked'));
      });
  </code></pre>
  
  <p>html "Check all":</p>
  
  <pre><code>&lt;input type="checkbox" id="checkall" name="checkall" class="checkbox checkall"&gt;
  </code></pre>
  
  <p>html table checkboxes:</p>
  
  <pre><code>&lt;input type="checkbox" value="1" class="checkbox"&gt;
  </code></pre>
  
  <p>this used to work just fine before switching to jquery 1.9.
  what gives??</p>