Entry
What are JavaScript style sheets?
What are JavaScript style sheets?
Mar 13th, 2000 03:27
Martin Honnen, http://developer.netscape.com:80/docs/manuals/communicator/dynhtml/index.htm
JavaScript style sheets were introduced by Netscape as an alternative
to css style sheets when they released their version 4 browser. Instead
of writing
<STYLE TYPE="text/css">
P { font-size: 24pt; }
</STYLE>
you write
<STYLE TYPE="text/javascript">
document.tags.P.fontSize = '24pt';
</STYLE>
More details at the above url.
Note that you don't gain any more flexibility or any more dynamics with
NN4 using javascript style sheets than using css style sheets. It is
simply another way of notation. So you can only statically set the font
size once with the above line but not later dynamically change it.
As other companies didn't pick up JavaScript style sheets and Netscape
abandoned them (no support in NN6) it is not advisable to learn/start
to use them nowadays unless you have to maintain existing code.