Skip to content

Instantly share code, notes, and snippets.

@kepford
Forked from nathansmith/check_all.js
Created June 1, 2011 21:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kepford/1003380 to your computer and use it in GitHub Desktop.
Save kepford/1003380 to your computer and use it in GitHub Desktop.
Used to check all checkboxes in a page.
(function(d) {
var input = d.getElementsByTagName('input');
var i = input.length;
while (i--) {
if (input[i].type === 'checkbox') {
input[i].setAttribute('checked', 'checked');
}
}
})(this.document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment