289Accessibility and Alternative Devices
functions to your site as switcher.js, all you need to do is link in the file, and add
onclick="setActiveStyleSheet('default'); return false;"
onclick="setActiveStyleSheet('large text'); return false;"
The setActiveStyleSheet function selects the style sheet to be applied. By calling
it with the title of the desired style sheet, we can allow users to select style sheets
from within the browser. As such, this technique can be used in conjunction with
that described in “How do I add alternative style sheets to my site?”. Visitors who
are able to change style sheets using their browser can still do so; others can use
You can also use this technique to change a site’ s color scheme, and even its layout,
provided you used CSS to position the page elements.
It’ s also possible to allow users to change your site’s style sheet by writing out the
link to the selected style sheet using server-side code, such as PHP. Examples of
the methods you can use to achieve this are linked to from the css-discuss Wiki.