Created
August 9, 2021 04:46
-
-
Save Vladimir-Novick/24d05ec00f391db2d53f0cc5565bf5b3 to your computer and use it in GitHub Desktop.
show_elements
This file contains 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
function show_elements(elements, specifiedDisplay) { | |
elements = elements.length ? elements : [elements]; | |
for (var index = 0; index < elements.length; index++) { | |
elements[index].style.display = specifiedDisplay || 'block'; | |
} | |
} | |
/* | |
// Usage: | |
var elements = document.querySelectorAll('.target'); | |
show_elements(elements); | |
show(elements, 'inline-block'); // The second param allows you to specify a display value | |
var c = node.childNodes; // get all chield elements | |
show_elements(c); | |
show(c, 'inline-block'); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment