Load an external stylesheet using JavaScript Example



The default background is gold. Try the dropdown before clicking “load CSS file”. You will notice the background does not change. Now click “load CSS file”, the classes used in the dropdown now exist!

The original post explaining in detail is here.

One Response to Load an external stylesheet using JavaScript Example

  1. Pingback: Load an external stylesheet using JavaScript

Leave a Reply

Your email address will not be published. Required fields are marked *

*

To include code in your comment: Paste your code in the comment form, select it and then click the language link button below. This will wrap your code in a <pre> tag(or shortcode) and format it when submitted.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="">