Return to Snippet

Revision: 22175
at January 4, 2010 19:20 by smoothdzion


Initial Code
var tog = false; // or true if they are checked on load 
 $('a').click(function() { 
    $("input[type=checkbox]").attr("checked",!tog); 
  tog = !tog; 
 });

Initial URL
http://groups.google.com/group/jquery-en/browse_thread/thread/ded7aae58024220b

Initial Description
Great short snippet of code to toggle checkboxes.
Thanks 	[Josh Nathanson](http://groups.google.com/groups/profile?enc_user=aAOlJRcAAAC7dB8ku2NsRGdjbPtXhPEXHqZiDvCVswhrZ6TQxKj0ww) for putting this simple code together.

Initial Title
jQuery - Toggle All Checkboxes

Initial Tags
jquery

Initial Language
jQuery