[thelist] Dynamically Adding Styles in all browsers

Saila, Craig Craig.Saila at bgminteractive.com
Mon Dec 9 09:52:01 CST 2002

> -----Original Message-----
> From: Donald Noble [mailto:donald at drnoble.co.uk]
> Sent: December 8, 2002 2:43 PM

> document.styleSheets[0].addRule("div#links div","display:none");
> works fine in IE6, but fails in Mozilla (1.2.1) doesn't
> appear to work in Opera 6 either.
> how can this be done so that it is more cross browser compatible.

Peter-Paul Koch has a terrific explanation and script sample at his site
to do this in a cross-broser way:
"Change style sheet"


Craig Saila
craig at saila.com : http://www.saila.com/

More information about the thelist mailing list