JavaScript check all checkboxes from querySelectorAll result

Content

Use querySelectorAll with forEach to check checkboxes.

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

Comments (RSS)

  1. anonymous

    ha