Skip to content

Instantly share code, notes, and snippets.

@atelic
Last active October 9, 2015 20:26
Show Gist options
  • Save atelic/e954706cfef4ee1ae5b2 to your computer and use it in GitHub Desktop.
Save atelic/e954706cfef4ee1ae5b2 to your computer and use it in GitHub Desktop.
// Checks or unchecks all checkboxes on a page
var setAllBoxes = function(value) {
var boxes = document.querySelectorAll('input[type="checkbox"]');
for(var i = 0; i < boxes.length; i++) {
boxes[i].checked = value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment