...

View Full Version : Firefox problem



JKF
09-11-2008, 01:18 PM
Hi everyone, hopefully you can help me with this annoying Firefox problem. I have the code below working fine in IE, yet in FF it won't do anything... Why?


<script type="text/javascript">
function Show_Stuff(Click_Menu)
{
if (Click_Menu.style.display == "none")
{
Click_Menu.style.display = "";
}
else
{
Click_Menu.style.display = "none";
}
}
</script>

<a href="javascript:Show_Stuff(display2)">click me</a>

<span ID="display2" style="display: none">
hello....</span>

rangana
09-11-2008, 01:30 PM
It's showing at my end, both on IE and FF. Verify your settings. It may have JS disabled.

JKF
09-11-2008, 01:40 PM
I've just checked and javascript is enabled in FF...

So when you try this, you click the link and the extra text appears, in FF?

rangana
09-11-2008, 01:54 PM
Yes. "hello...." shows right beside click me link.

abduraooft
09-11-2008, 02:05 PM
Change it like

<a href="#" onclick="Show_Stuff('display2'); return false;">click me</a>

<script type="text/javascript">
function Show_Stuff(Click_Menu)
{
var elm=document.getElementById(Click_Menu);
if (elm.style.display == "none")
{
elm.style.display = "";
}
else
{
elm.style.display = "none";
}
}
</script>

JKF
09-11-2008, 02:10 PM
Thanks abduraooft, top man!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum