This is a test heading

This is a test paragraph. Click the buttons to change the stylesheet(s).

all.css styles the link
Default colours the background and gives default font colours
Pretty changes the fonts and font styles, aligns the buttons and provides a different background
Big font changes all font sizes
High contrast changes all colours to make things easy to see, and overrides the link styles

The script is held in a [Download] JavaScript header file and is able to use a cookie to remember the user's choice of stylesheets. In this case, I have chosen to remember that choice only until the browser is closed.

If you are interested, I have also written [Download] this alternative version, which uses the document.styleSheets collection wherever possible. It is not so efficient as the other version, and I do not recommend its use.

Back to the JavaScript tutorial.