JavaScript check all checkboxes from querySelectorAll result

Use querySelectorAll with forEach to check checkboxes.

document.querySelectorAll('[type=checkbox]').forEach((checkbox) => {
  checkbox.checked = true;
});
This post is available on GitHub.
Posted .

Comments

Leave a Reply