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 );

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *