Jump to content

Recommended Posts

Hi There,

 

I have created a function on my site that should display and hide text. This works perfectly fine in all the browsers except Firefox!! FireBug tells me that the Div I am trying to display is not defined and it has been defined so weird!! My website is www.zahidchaudhry.com. The link I am talking about is in the bottom called Show Text (i have added an image) :D

 

Please help with this.

 

Cheers - Zahid

 

[attachment deleted by admin]

Try changing the function to:

 

<script type="text/javascript">
function Display(num)
{
	var text1 = document.getElementById('text1');
	var text2 = document.getElementById('text2');

	if (num == 1)
	{
		text1.style.display = "block";
		text2.style.display = "none";
	}
	else if (num == 2)
	{
		text1.style.display = "none";
		text2.style.display = "block";
	}
}
</script>

 

Adam!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.