I am completely new to scripts and i would like to have hidden elements in my text, that will be displayed when cliking on a show.png
I found that script which is simple, and I want it to make the contrary : show hidden text instead of hide a visible text:
<div class="hide1">One</div>
<div class="hide2">Two</div>
<a href="#" onclick="ToggleVisibility('hide1'); return false;">One</a>
<a href="#" onclick="ToggleVisibility('hide2'); return false;">Two</a>
<a href="#" onclick="ToggleVisibility('nosuchclass'); return false;">No hide</a>
< -------------------------------------------------------->
function ToggleVisibility(divClass)
{
var els = document.getElementsByClassName(divClass);
for(var i = 0; i < els.length; i++)
{
els[i].style.visibility = els[i].style.visibility == "hidden" ? "visible" : "hidden";
}
}
As I don't even know how to call it, i have problems finding the solution on the web
Thank you for your help