Created
February 3, 2014 17:13
-
-
Save mpnordland/8788021 to your computer and use it in GitHub Desktop.
Bookmarklets to quickly check and uncheck checkboxes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check all | |
javascript:(function(){$('input[type="checkbox"]').attr('checked',true);})(); | |
Uncheck all | |
javascript:(function(){$('input[type="checkbox"]').attr("checked",false);})(); | |
These require jQuery, non jQuery versions welcome | |
Designed to cope with Drupal (TM) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// Check all checkboxes
Array.prototype.slice.call( document.querySelectorAll( 'input[type="checkbox"]' ) ).forEach( checkbox => checkbox.checked = true );
// Uncheck all checkboxes
Array.prototype.slice.call( document.querySelectorAll( 'input[type="checkbox"]' ) ).forEach( checkbox => checkbox.checked = false );