I was working on a simple show and hide function and it kept telling me that it's not defined.
Here's the HTML:
<address>
<a id="windows" href="#" onclick="toggle();">
<img src="imges/c980e3f5-badf-432a-ae6c-9e5341d13462.png" alt="" />
</a>
</address>
<p class="right_page">
this is sample of the book container<br/>
thats suppose to read from ajax
</p>
and here the function
<script type="text/javasript">
function toggle()
{
var ele = document.getElementById("right_page");
var text = document.getElementById("windows");
if(ele.style.display == "block") {
ele.style.display = "none";
text.innerHTML = "show";
}
else {
ele.style.display = "block";
text.innerHTML = "hide";
}
}
</script>