Skip to content

Instantly share code, notes, and snippets.

@fobidlim
Created March 15, 2021 01:56
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 fobidlim/f528a939c25137657440360c11119f5f to your computer and use it in GitHub Desktop.
Save fobidlim/f528a939c25137657440360c11119f5f to your computer and use it in GitHub Desktop.
// toggle all to viewed
document.querySelectorAll('.js-reviewed-checkbox').forEach((elem => {
if (elem.checked) { return }
var clickEvent = new MouseEvent('click');
elem.dispatchEvent(clickEvent);
}))
// toggle all to not-viewed
document.querySelectorAll('.js-reviewed-checkbox').forEach((elem => {
if (!elem.checked) { return }
var clickEvent = new MouseEvent('click');
elem.dispatchEvent(clickEvent);
}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment