JS snippet to uncheck lots of checkboxes on a page

Mimicks a click event in case something is bound to the click event:

document.querySelectorAll('input[type="checkbox"]').forEach(checkbox => {
  if (checkbox.checked) {
    checkbox.click();
  }
});Code language: JavaScript (javascript)
Updated 2026-04-03

Categories

,

Tags:

Tree: