Skip to content

Instantly share code, notes, and snippets.

@johndyer
Forked from nathansmith/check_all.js
Created June 1, 2011 21:24
Show Gist options
  • Save johndyer/1003360 to your computer and use it in GitHub Desktop.
Save johndyer/1003360 to your computer and use it in GitHub Desktop.
Used to check all checkboxes in a page.
(function(d) {
var input = d.getElementsByTagName('input'),
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