3 ms·
You can modify every item in a query pretty nicely with a one-liner in modern browsers now: document.querySelectorAll('input[type=checkbox]').forEach((i) =
by spankalee 2y ago
You can modify every item in a query pretty nicely with a one-liner in modern browsers now:
document.querySelectorAll('input[type=checkbox]').forEach((i) => i.checked = false);
This takes advantage of iterable NodeList and iterator helpers.
Many parent queries can be done with element.closest()