jQuery – How to check all checkboxes on page

The following jQuery will set all checkboxes on a page to checked/ticked/selected.

NOTE: it’s been written for WordPress, which uses ‘jQuery’ instead of ‘$’ – if you’re using this outside of WordPress replace ‘jQuery’ with ‘$’

jQuery( "input[type=checkbox]" ).prop( 'checked', true );

Was this article helpful?

Related Articles