
4th
Feb 10
Feb 10
Checking (and unchecking) all Checkboxes with JQuery
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); }); |






