Skip to content

Instantly share code, notes, and snippets.

@rspurrell
Last active July 30, 2020 03:07
Show Gist options
  • Save rspurrell/33a459882d9904cc83a7a3339c5d6cca to your computer and use it in GitHub Desktop.
Save rspurrell/33a459882d9904cc83a7a3339c5d6cca to your computer and use it in GitHub Desktop.
Check all checkboxes
var inputs = document.getElementsByTagName("input");
for (let i = 0; i < inputs.length; i++) {
let e = inputs[i];
if (e.type == "checkbox" && !e.checked) {
e.checked = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment