[thelist] Dynamically Adding Styles in all browsers

Donald Noble donald at drnoble.co.uk
Sun Dec 8 13:43:01 CST 2002


Hi evolters,

I am trying to add a couple of CSS rules to a page using this
Javascript.

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.

cheers :Donald

+-----------------------------------------+
  personal site: http://www.drnoble.co.uk
+-----------------------------------------+
   http://www.AccessibleComputers.co.uk
Hardware, Software, Custom built PC Systems
+-----------------------------------------+




More information about the thelist mailing list