Hey guys, I hope someone can help with this problem, I tried a lot of scripts and workarounds, but can't get this simple job to work. As the headline has it, how can I make my text NOT go to the top of the page. here is the code.
<script type="text/javascript"> function toggleVisibility() { document.getElementById("toggleMe").style.display = ""; if(document.getElementById("toggleMe").style.visibility == "hidden" ) { document.getElementById("toggleMe").style.visibility = "visible"; } else { document.getElementById("toggleMe").style.visibility = "hidden"; ev.preventDefault(); return false; } } </script> <a href="#" onclick="toggleVisibility();">Click to toggle visibility.</a></p> <div id="toggleMe" style="visibility: hidden;"> Something to Hide and show.
The display collapses the layout, and visibility saves it.
all in the same html file. I read what the outters did, and I tried ev.preventDefault (); return false; code at the end of the function, but nothing.
Thanks!
Ollie source share