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.stylesheet[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)
.



Relevant Pages

  • Re: Changing CSS styles
    ... Aaron Gray wrote on 29 feb 2008 in comp.lang.javascript: ... I cannot remember how to change CSS style properties. ... var rules = ss.cssRules? ...
    (comp.lang.javascript)
  • Re: Changing CSS styles
    ... I cannot remember how to change CSS style properties. ... var rules = ss.cssRules? ... Aaron ...
    (comp.lang.javascript)
  • Re: Changing CSS styles
    ... I cannot remember how to change CSS style properties. ... var rules = ss.cssRules? ... Presumably this will not work on NN4. ...
    (comp.lang.javascript)