Include CSS Stylesheet by DOM
General
Use this script when you want to use the DOM to include a cascading style sheet. Very simple to implement.
Notes
- Created by: Benoit Asselin
- Web Site: http://www.ab-d.fr/
- Posted: October 12, 2007
Source Code
Paste this source code into the designated areas.
External file
Paste this code into an external JavaScript file named: includeCSS.js
Head
Paste this code into the HEAD section of your HTML document.


Leave a Response
(4 comments)Ok this
Sorry, interested but why would I want to do this?[br /][br /]Can it be integrated with jquery?[br /][br /]Bit of a novice I'm afraid.
You would call the function something like this:[br /][br /]window.onload = function() {[br /] includeCSS('style/yourStyle.css');[br /]}
An example of how to use this would be very useful, please.