...

View Full Version : Something silly



-Stu-
10-24-2005, 11:57 AM
Hi all,

Making a mess of this, simple problem... Help!! :o



function MakeVis(MenuID) {
alert(MenuID);
document.write(MenuID)
document.all.MenuID.style.visibility="visible";
}

document.write(MenuID) produces the text "Menu1"
Now I know MenuID is a variable and I want to reflect this in the document.all line but Its just not happening. What am I doing wrong?

Kor
10-24-2005, 12:27 PM
a lot of things are wrong.

I guess that you wanted to do something like this

function MakeVis(MenuID){
document.getElementById(MenuId).style.visibility='visible';
}

Anyway, can we see the whole code? What is your final purpose?

-Stu-
10-24-2005, 12:55 PM
That is all the code :)

All sorted now anyway. Sorry for the trouble, Hadn't woken up yet. Thanks for the reply though. :)

Kor
10-24-2005, 12:58 PM
document.all is an IE only reference. I strongly advice you to use
document.getElementById(someid) instead



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum