Thanks Hassan. I think I like option number two. So how do I add the class to
the body tag
with js?
--- In JS-Jive@yahoogroups.com, "Hassan Schroeder" <hassan.schroeder@...> wrote:
>
>
> document.write is (IMO) clumsy and ugly, and doesn't work in a true
> XHTML page. Forget you ever heard of it :-)
>
> Alternatives:
>
> 1) directly manipulate the style rules -- google "DOM stylesheet" for
> more info and examples; probably won't scale well if you have a
> lot of rules. Also, there are some browser compatibility issues --
> surprise!
>
> 2) put all your rules in one stylesheet; make the "with JS" rules depend
> on the cascade, e.g.
>
> h1 { color: red; } /* no JS style */
> .js h1 { color: green; } /* with JS style */
>
> and add the class "js" to the body tag via JavaScript.
>
> FWIW!
> --
> Hassan Schroeder ------------------------ hassan.schroeder@...
>