Hi I am trying to use this code that was submitted on dreamincode.net. The trouble i am having is that the page will always go back to the top everytime i click the link. Does anyone know how i can prevent this from happening?
Thanks
<script type="text/javascript">
function hide(status) {
if (status == "hidden") {
document.getElementById("textbox").style.visibility = "hidden";
document.getElementById("button").innerHTML = "<a onclick=\"hide(\'show\')\" href=\"#\">Show Textbox<\/a>";
}
else {
document.getElementById("textbox").style.visibility = "visible";
document.getElementById("button").innerHTML = "<a onclick=\"hide(\'hidden\')\" href=\"#\">Hide Textbox<\/a>";
}
}
</script>
<textarea id="textbox"></textarea><br>
<span id="button">
<a onclick="hide('hidden')" href="#">Hide Textbox</a>
</span>


Reply With Quote
Bookmarks