Menu

gitpiper

hide javascript Code Snippet in 2023

browsercssbeginner

Last Updated: 28 January 2023

Hides all the elements specified.

  • Use the spread operator (...) and Array.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

javascript snippet similar to hide For You in January 2023

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2023 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️