[thelist] RE: javascript - changing css with javascript

Dru and Cindy Sellers dru at zetachi.org
Sat Sep 28 22:44:01 CDT 2002


First I would like to thank .jeff and Duncan O'Neil for their help with my
problem.
However I am having a problem getting the script to work in both Mozilla and
IE. After doing some research on DOM stuff and here is my new bath of code
based on .jeff's one liner

function cssMenu(obj)
{
  document.getElementById(" + obj + ").style.display =
(document.getElementById(" + obj + ").style.display == 'none') ? 'block' :
'none';
}

however, I can not seem to find the right term to search on that explains
how to use a variable in the getElementById() function. It seems to want a
string in quotes in the () but if I just put (obj) it does not work.

Thanks for any support!!!!

Dru
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 9/19/02




More information about the thelist mailing list