JavaScript check all checkboxes from querySelectorAll result

Use querySelectorAll with forEach to check checkboxes.

document.querySelectorAll('[type=checkbox]').forEach((checkbox) => {
checkbox.checked = true;
});
View this page on GitHub.
Posted .

Comments

Leave a Reply