Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 348 Bytes

hide.md

File metadata and controls

16 lines (12 loc) · 348 Bytes
title tags
hide
browser,css,beginner

Hides all the elements specified.

  • Use NodeList.prototype.forEach() to apply display: none to each element specified.
const hide = (...el) => [...el].forEach(e => (e.style.display = 'none'));
hide(document.querySelectorAll('img')); // Hides all <img> elements on the page