Posted By

derekholmes on 12/11/09


Tagged

checkbox


Versions (?)

Select all Checkboxes


 / Published in: jQuery
 

Selects all checkboxes and checks or unchecks them.

chk_All = id(s) of the check box to add an onclick event for
  1. $(document).ready(function(){
  2.  
  3. $("#chk_All").click(function()
  4. {
  5. var checked_status = this.checked;
  6. $("input[type='checkbox']").each(function()
  7. {
  8. this.checked = checked_status;
  9. });
  10. });
  11.  
  12. });

Report this snippet  

You need to login to post a comment.