html how to hide and show multiple

Solutions on MaxInterview for html how to hide and show multiple by the best coders in the world

showing results for - "html how to hide and show multiple"
Diego Alejandro
25 Sep 2017
1function ToggleVisibility(divClass)
2{
3    var els = document.getElementsByClassName(divClass);
4    for(var i = 0; i < els.length; i++)
5    {
6        els[i].style.visibility = els[i].style.visibility == "hidden" ? "visible" : "hidden";
7    }
8}
9
Simone
13 Jun 2016
1<div class="hide1">One</div>
2<div class="hide2">Two</div>
3
4<a href="#" onclick="ToggleVisibility('hide1'); return false;">One</a>
5<a href="#" onclick="ToggleVisibility('hide2'); return false;">Two</a>
6<a href="#" onclick="ToggleVisibility('nosuchclass'); return false;">No hide</a>
7
similar questions
queries leading to this page
html how to hide and show multiple