title: check all checkboxes
body: <p>I have a table with checkboxes and I want to do the "check all" and "un-check all" checkboxes but I could not find the way to check all the checkboxes.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;form&gt;
      &lt;?php foreach ($this-&gt;entries as $entry): ?&gt;
          &lt;tr class="table_head_seperator"&gt;
              &lt;td class="grid_info" width="32px" bgcolor="#f6f6f6"&gt;&lt;input type="checkbox" class="chk_boxes1" name="to_delete[&lt;?PHP echo $entry['id'] ?&gt;]"  /&gt;&lt;/td&gt;
              &lt;td class="grid_info" width="160px" bgcolor="#eeeeee"&gt;&lt;span class="country_name"&gt;&lt;?php echo $entry['user_name'] ?&gt;&lt;/span&gt;&lt;/td&gt;
              &lt;td class="grid_info" width="130px" bgcolor="#eeeeee"&gt;&lt;span class="country_name"&gt;&lt;?php echo $entry['date_created'] ?&gt;&lt;/span&gt;&lt;/td&gt;
              &lt;td class="grid_info" width="100px" bgcolor="#f6f6f6"&gt;&lt;span class="country_name"&gt;&lt;?php echo $entry['user_type_name'] ?&gt;&lt;/span&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;?PHP endforeach; ?&gt;
  
      &lt;input type="checkbox" class="chk_boxes" label="check all"  /&gt;check all
      &lt;input type="checkbox" class="unchk_boxes"   /&gt; un-check all
  &lt;/form&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $('.chk_boxes').click(function(){
              $('.chk_boxes1').attr('checked',checked)
          })
      });
  &lt;/script&gt; 
  </code></pre>