Last active
July 3, 2020 13:44
-
-
Save iceener/fcfbbc98a2a47921d7af2b66048c3ac1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Toggle visibility (CSS: .hidden { display: none }) | |
const hide = (els, visibilityClass = 'hidden') => [...els].forEach(el => el.classList.toggle(visibilityClass)); | |
// Example: hide all img elements | |
hide(document.querySelectorAll('img')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment