title: Check and uncheck all checkboxes with jquery
body: <p>I am using this script to check and uncheck all checkboxes:</p>
  
  <pre><code>$('#checkall').click(function () {
      var checked = $(this).data('checked');
      $('.chkall').find(':checkbox').attr('checked', !checked);
      $(this).data('checked', !checked);
  });
  </code></pre>
  
  <p>It works great, but as soon as I uncheck several checked checkboxes after "check all" and then hit "uncheck all" and "check all" again, those previously unchecked checkboxes are not checked again. Help would be great! Thank you very much!</p>