I want to hide something on my website & show it with javascript. Like this:
''Click Here For Options'' Then when you click the link the options tab opens up...
I found this code it works, but the content IS SHOWN by default, then when you click the link it hides it:
Does anyone know how i can make this the other way round & hide the content by default then display it when i click the link?
''Click Here For Options'' Then when you click the link the options tab opens up...
I found this code it works, but the content IS SHOWN by default, then when you click the link it hides it:
Code:
<a href="javascript:hideshow(document.getElementById('adiv'))">Click Here For Options</a>
<script type="text/javascript">
function hideshow(which){
if (!document.getElementById)
return
if (which.style.display=="block")
which.style.display="none"
else
which.style.display="block"
}
</script>
<div id="adiv" style="font:24px bold; display: block">my code to display the options</div>
Does anyone know how i can make this the other way round & hide the content by default then display it when i click the link?