"Dennis Marks" asked
Quote:
In the following function:
function showMenu(theMenu, theAction) {
if (document.getElementById)
{document.getElementById(theMenu).style.visibility = theAction;}
else {if (document.layers) {document.theMenu.visibility = theAction;}
else {document.all.theMenu.style.visibility = theAction;}}
}
Will the passed value of theMenu be substituted in the last 2 lines or
will it use "theMenu" as the value? |
The latter.
Quote:
Do I have to use the following:
eval("document.all."+theMenu+".style.visibility") |
No. Try document.all[theMenu].style.etc.
with square brackets, no eval and no quotes.
HTH
Ivo