Skip to content

Instantly share code, notes, and snippets.

@simofacc
Created August 6, 2020 07:43
Show Gist options
  • Save simofacc/8b42c5835114963b0e21f7adba9da786 to your computer and use it in GitHub Desktop.
Save simofacc/8b42c5835114963b0e21f7adba9da786 to your computer and use it in GitHub Desktop.
Tick multiple checkboxes and trigger onChange event
document.querySelectorAll("input[type=checkbox]").forEach(c => { c.checked = true; c.onchange(); });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment