Skip to content

Instantly share code, notes, and snippets.

@bobvanluijt
Created August 1, 2018 20:00
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 bobvanluijt/4f766bfaa86a3eee0ce10caded2e7277 to your computer and use it in GitHub Desktop.
Save bobvanluijt/4f766bfaa86a3eee0ce10caded2e7277 to your computer and use it in GitHub Desktop.
check all checkboxes in DOM
var checkboxes = document.getElementsByTagName("*");
for (var i=0, max=checkboxes.length; i < max; i++) {
if (checkboxes[i].type == 'checkbox') {
checkboxes[i].checked = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment