[thelist] RE: javascript - changing css with javascript
.jeff
jeff at members.evolt.org
Sat Sep 28 23:02:00 CDT 2002
dru,
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Dru and Cindy Sellers
>
> 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.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
lose the quotes in the function above.
document.getElementById(obj)
then, it'll all depend on how you're calling the cssMenu() function. call it and pass a string that's the id of an object on the page you want to toggle the display of.
cssMenu('myDiv');
good luck,
.jeff
http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/
More information about the thelist
mailing list