cssRules in IE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christopher Benson-Manica

    cssRules in IE

    Supposedly IE implements the cssRules property for a stylesheet. So
    why is the word 'foo' in the below page red and not blue?

    <html>
    <head>
    <style>
    .foo { color: #ff0000; }
    </style>
    </head>
    <body>
    <span class="foo">foo </span>
    <script type="text/javascript">
    document.styleS heets[0].cssRules[0].style.color='# 0000ff';
    </script>
    </body></html>

    --
    Christopher Benson-Manica | I *should* know what I'm talking about - if I
    ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
  • Evertjan.

    #2
    Re: cssRules in IE

    Christopher Benson-Manica wrote on 03 mrt 2005 in comp.lang.javas cript:
    [color=blue]
    > Supposedly IE implements the cssRules property for a stylesheet. So
    > why is the word 'foo' in the below page red and not blue?
    >
    > <html>
    > <head>
    > <style>
    > .foo { color: #ff0000; }
    > </style>
    > </head>
    > <body>
    > <span class="foo">foo </span>
    > <script type="text/javascript">
    > document.styleS heets[0].cssRules[0].style.color='# 0000ff';
    > </script>
    > </body></html>
    >[/color]

    IE uses rules[]

    document.styleS heets[0].rules[0].style.color='# 0000ff';

    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)

    Comment

    Working...