
4th
Feb 10
Feb 10
Checking (and unchecking) all Checkboxes with JQuery
Posted Thursday 4th February 2010
If you wish to check (tick) or uncheck (untick) all checkboxes with JQuery use the find, each and attr functions. This will loop through every checkbox element and set the attribute you want.
Example of checking every checkbox:
1 2 3 | $("#div").find("input[type='checkbox']").each(function(){ $(this).attr('checked', true); }); |
Bookmark or share this page:
Related posts:
MSN Contact: contact [at] danielgibbs.net
Dan Gibbs is a web developer, designer and SEO consultant involved in devon web design.





