Re: Changing CSS styles



Aaron Gray wrote on 29 feb 2008 in comp.lang.javascript:

Hi,

I cannot remember how to change CSS style properties.

I want something like :-

document.style***[0].class["slideshow"].width = 100;

But this is not working. I need something that works on IE and FF, and
ideally even NS4.

document.styleSheets[0].cssRules[0] //access the first rule in Firefox
document.styleSheets[0].rules[0] //access the first rule in IE Win

<http://www.javascriptkit.com/domref/cssrule.shtml>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.


Quantcast