Using jQuery, how can I:
Have all checkboxes on a page turned checked on or off?
Loop through all the checkboxes on the page which are selected. I.e something like this
$(sel-cboxes).each(myFunction);
So myFunction would be called on each selected checkbox.
Thanks in advance!
1: To check all checkboxes
$("input:checkbox").attr('checked', true);
To uncheck all
$("input:checkbox").attr('checked', false);
2:
$("input:checkbox:checked").each(myFunction);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With