I want to do this with all the navigation menu links on my site. (I know, it sounds crazy, but I thought I'd give it a try and see if it looks cool) I already have a site that uses css and onhover to change the color of the links in the navigation menu when the mouse hovers over it. But I want to make the font also rapidly change font face until the mouseout event. So, here is the script section that I have in the head section.
<script>
var changeVar;
var font = "Impact";
changeText() {
if font == "Impact" {
document.getElementById("tops").style.fontFamily="courier";
font = "Courier";
}
else
document.getElementById("tops").style.fontFamily="impact";
font = "Impact";
}
}
</script>
And here is the navigation link I'm using to test it.
<li><a href="tops.html" id="tops" onmouseover="changeVar=setInterval('changeText()', 10);" onmouseout="clearTimeout(changeVar)">Tops</a></li>
Even though I put that stuff in there, the page does exactly the same thing it did before I put the JavaScript in there. The JavaScript just isn't working at all. Why doesn't it work?