View Single Post
Old 11-25-2003, 10:17 PM   PM User | #7
COBOLdinosaur
Regular Coder

 
COBOLdinosaur's Avatar
 
Join Date: Jul 2002
Location: Canada
Posts: 293
Thanks: 0
Thanked 18 Times in 18 Posts
COBOLdinosaur is an unknown quantity at this point
If you are trying to get generated CSS into the page can you not use the methods of the stylesheet object:

For IE:
document.styleSheets[0].addRule('h1,'color:red');
For Moz:
document.stylesheet[0].insertRule("h1 {color:red}", 0);

Or if you want to change the rule dynamically you can use:

document.styleSheets[i].rules[j].style.setProperty('color','red',null);

Which is standard, but not as reliable (at least in IE) as:

document.styleSheets[i].rules[j].style.color = '12pt';

Oh.... rules is IE only for Moz you have to use cssRules instead
__________________
100% standards compliant code is 100% correct 100% of the time.
one of my toys from my repository and perhaps some help getting help

Cd&
COBOLdinosaur is offline   Reply With Quote