JavaScript check all checkboxes from querySelectorAll result

Use querySelectorAll with forEach to check checkboxes.

document.querySelectorAll('[type=checkbox]').forEach((checkbox) => {
  checkbox.checked = true;
});
Did this help you? Please let me know with a comment. Thank you
Posted .

Comments (RSS)

Leave a comment