When I run this script on my localhost, it works great with both IE7 and Firefox3. But when I've uploaded it to my site, it only works with IE, and not Firefox. The script should just hide the DIV after 2 seconds. <html> <head> <SCRIPT language="JavaScript"> <!-- function Hidenn() { setTimeout("HideMenus()",2000); } function HideMenus() { menuss1.style.visibility = 'hidden'; } //--> </SCRIPT> </head> <body> <a href="#" onclick="Hidenn();">Link 1 </a> <div id="menuss1">hddhdhdhd</div> </body> </html> Code (markup): Any suggestions on how I could fix this?
you need to stop the propagation of the onclick event - return false or whatever. and menuss1.style.visibility -> change to document.getElementById("menuss1").style.visibility.