Created
February 19, 2014 12:05
-
-
Save mjac/9090654 to your computer and use it in GitHub Desktop.
Check all the checkboxes in a page
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
var allCheckboxNodes = document.querySelectorAll('input[type=checkbox]'); | |
var allCheckboxes = Array.prototype.slice.call(allCheckboxNodes, 0); | |
allCheckboxes.forEach(function (node) | |
{ | |
node.setAttribute('checked', 'checked'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment