title: select all checkbox only works twice
body: <p>I got this code from stackoverflow which looks like a pretty good "select all" checkbox solution, any ideas why it fails after 2nd click? </p>
  
  <p><a href="http://jsfiddle.net/R9zjk/2/" rel="nofollow">http://jsfiddle.net/R9zjk/2/</a></p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;input type='checkbox' value='0' class=''&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;input type='checkbox' value='0' class=''&gt;
          &lt;/td&gt;
          &lt;td&gt;
              &lt;input type='checkbox' value='0' class=''&gt;
          &lt;/td&gt;
          &lt;td width="100" align="right"&gt;
              select all &lt;input type='checkbox' value='0' class='selectall2'&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  
  $(document).ready(function () {
  
  
      $(document).on("click", ".selectall2", function () {
  
  
          $(this).closest('tr').find('input[type=checkbox]').attr('checked', this.checked);
  
  
      });
  
  
  
  });
  </code></pre>