Skip to content

Instantly share code, notes, and snippets.

@yblee85
Created September 23, 2015 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yblee85/cd2519a88c7444e6aefa to your computer and use it in GitHub Desktop.
Save yblee85/cd2519a88c7444e6aefa to your computer and use it in GitHub Desktop.
include CSS file / add new CSS
function includeCSSfile(href) {
var head_node = document.head || document.getElementsByTagName('head')[0];
var link_tag = document.createElement('link');
link_tag.setAttribute('rel', 'stylesheet');
link_tag.setAttribute('type', 'text/css');
link_tag.setAttribute('href', href);
head_node.appendChild(link_tag);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment