Using JavaScript code as a stylesheet, JSSS styles individual element by modifying properties of a document.tags object. For example, the CSS:
is equivalent to the JSSS:
JSSS element names are case sensitive.
JSSS lacks the various CSS selector features, supporting only simple tag name, class and id selectors. On the other hand, since it is written using a complete programming language, stylesheets can include highly complex dynamic calculations and conditional processing. (In practice, however, this can be achieved using JavaScript to modify the stylesheets applicable to the document at runtime.) Because of this JSSS was often used in the creation of dynamic web pages.
The following example shows part of the source code of an HTML document:
Similar to Cascading Style Sheets, JSSS could be used in a <style> tag. This example shows two different methods to select tags.
Javascript Style Sheets were only supported by Netscape 4.x (4.0–4.8) but no later versions. No other web browser has ever implemented JSSS.
Håkon Wium Lie; Bert Bos. "Chapter 20 - The CSS saga". World Wide Web Consortium. Retrieved 23 June 2010. /wiki/H%C3%A5kon_Wium_Lie ↩