Skip to content

Instantly share code, notes, and snippets.

@hlashbrooke
Created July 12, 2013 11:03
Show Gist options
  • Save hlashbrooke/5983623 to your computer and use it in GitHub Desktop.
Save hlashbrooke/5983623 to your computer and use it in GitHub Desktop.
Simplest jQuery method for selecting all checkboxes in a form
$( '.selectall' ).click( function () {
$( this ).closest( 'form' ).find( ':checkbox' ).attr( 'checked' , this.checked );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment