By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,463 Members | 2,954 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,463 IT Pros & Developers. It's quick & easy.

cssRules in IE

P: n/a
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.styleSheets[0].cssRules[0].style.color='#0000ff';
</script>
</body></html>

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Christopher Benson-Manica wrote on 03 mrt 2005 in comp.lang.javascript:
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.styleSheets[0].cssRules[0].style.color='#0000ff';
</script>
</body></html>


IE uses rules[]

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

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

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.