Select or Clear All Checkboxes on a Web Page
This script clicks enabled checkboxes in the current page so you can change them together instead of one at a time.
Before you run it
Run this only on pages you trust. A page may react to checkbox clicks by changing settings or sending requests. Review the resulting selections before submitting or saving anything.
Run it in DevTools
Open the target page and run the code below in the DevTools Console. If F12 does not open DevTools in your browser, use the browser menu.
| |
To clear all enabled checkboxes, use this code.
| |
Create a bookmarklet
Create a bookmark and paste the one-line code below into the bookmark URL field using the bookmark editor. Do not enter it in the address bar. Choose the bookmark while viewing the target page to select enabled checkboxes.
Select all:
| |
Clear all:
| |
To clear the selections, use the second code sample or the clear-all bookmarklet. The script affects only the current document and skips disabled checkboxes.
Changing the .checked property alone may not notify page code through the events that normally accompany a click. .click() triggers click behavior. Page-specific handlers can still prevent some items from changing.
