title: check all the checkbox using checkbox
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/11380555/checkbox-check-all-option">checkbox check all option</a>  </p>
  </blockquote>
  
  
  
  <pre><code>&lt;form action='ppc_logistic-control_number.php' target='_blank' method='post'&gt;
  &lt;b&gt;Sample Program&lt;/b&gt;&lt;br&gt;
  &lt;input type='checkbox'&gt;
  &lt;?php
  for($i=0;$i&lt;5;$i++)
  {
  print"&lt;input name='checkbox[]' type='checkbox' id='checkbox[]' value='$i-&gt;logi_id' value='$i-&gt;ppc_id' style='margin-left:-5px'&gt;&lt;br&gt;";
  }                       
  ?&gt;
  &lt;input type="submit" value="submit" name="gen"/&gt;
  </code></pre>
  
  <h2>    </h2>
  
  <p>what jquery or javascript code i need to place here in order: when i check the checkbox in top of 5 checkbox, all the checkbox will have a check, and when I remove the checkbox that ive previously check also the 5 checkbox will remove thier check.</p>
  
  <hr>
  
  <p>sample:
  <img src="https://i.stack.imgur.com/2jPGi.jpg" alt="enter image description here"></p>
  
  <hr>
  
  <p>sample demo thank you so much.</p>