Código Javascript
:
Ver original<script>
function toggle()
{
var ele = document.getElementsByClassName("toggleText");
var text = document.getElementsByClassName("displayText");
if(ele.style.display == "block")
{
ele.style.display = "none";
text.innerHTML = "show";
}else {
ele.style.display = "block";
text.innerHTML = "hide";
}
}
</script>
<a class="displayText" href="javascript:toggle();">show</a>
<div class="toggleText" style="display:none"><h1>peek-a-boo</h1></div>