Chuck's Notes

A WordPress-based Digital Garden

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)