348 B
348 B
title, tags
| title | tags |
|---|---|
| hide | browser,css,beginner |
Hides all the elements specified.
- Use
NodeList.prototype.forEach()to applydisplay: noneto each element specified.
const hide = (...el) => [...el].forEach(e => (e.style.display = 'none'));
hide(document.querySelectorAll('img')); // Hides all <img> elements on the page