We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

hellolabs on 09/19/07


Tagged

checkboxes


Versions (?)


Who likes this?

10 people have marked this snippet as a favorite

luman
bartekk
francisre
gedittest
vali29
AgentPhoenix
assbach
martingoldszein
blackabee
korzhik


JQuery: select-all checkboxes


Published in: JavaScript 


("#checkboxall") = checkbox identifier [@name=checkall] = name for all linked checkboxes

  1. $(document).ready(function(){
  2.  
  3. $("#checkboxall").click(function()
  4. {
  5. var checked_status = this.checked;
  6. $("input[@name=checkall]").each(function()
  7. {
  8. this.checked = checked_status;
  9. });
  10. });
  11.  
  12. });

Report this snippet 

Comments

RSS Icon Subscribe to comments
Posted By: assbach on March 24, 2008

do you know how to do this with arrays? like ...

You need to login to post a comment.