...

View Full Version : Toggle text?



angst
07-07-2007, 09:26 PM
hello,
I'm trying to toggle this text, but it's not working, and i can't see why.




<div id='HeaderLink' name='HeaderLink' onclick='HideHeaders()'>View Headers</div>
<script>
function HideHeaders(){
var strLink = document.getElementById("HeaderLink").innerHTML;
strLink= (strLink == "Hide Headers") ? "View Headers" : "Hide Headers";
}
</script>


any ideas would be great!

thanks in advance for your time!
-Ken

Bill Posters
07-07-2007, 10:47 PM

var strLink = document.getElementById('HeaderLink');
strLink.innerHTML = (strLink.innerHTML == 'Hide Headers') ? 'View Headers' : 'Hide Headers';



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum