Skip to content

Instantly share code, notes, and snippets.

@dasegn
Created April 12, 2016 16:46
Show Gist options
  • Save dasegn/44a42e7acca6c06f7787e6cca7d6662e to your computer and use it in GitHub Desktop.
Save dasegn/44a42e7acca6c06f7787e6cca7d6662e to your computer and use it in GitHub Desktop.
Check all the radio/checkbox controls in the page
(function() {
var aa = document.querySelectorAll("input[type=checkbox]");
for (var i = 0; i < aa.length; i++){
aa[i].checked = true;
}
var ab = document.querySelectorAll("input[type=radio]");
for (var i = 0; i < ab.length; i++){
ab[i].checked = true;
}
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment