Skip to content

Instantly share code, notes, and snippets.

@bencooper222
Last active August 12, 2016 16:07
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 bencooper222/da1fc5c51901bfb72c3f2015d67f528c to your computer and use it in GitHub Desktop.
Save bencooper222/da1fc5c51901bfb72c3f2015d67f528c to your computer and use it in GitHub Desktop.
Selects all messages on Squirrelmail to allow for easy deleting on servers that have quotas (was designed to work with the student and alumni squirrelmail at IMSA)
var inputs = document.getElementsByTagName("input");
var checkboxes = [];
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == "checkbox") {
checkboxes[checkboxes.length] = inputs[i];
}
}
for (var j = 0; j < checkboxes.length / 2; j++) {
checkboxes[j].checked = true;
}
console.log(checkboxes);
@bencooper222
Copy link
Author

Accidentally used the = assigning operator instead of the == operator the first time around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment