×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: pery mimon
Added: Feb 13, 2017 9:55 AM
Modified: Feb 13, 2017 10:00 AM
Views: 15
allow me to change some <link css> by user select
  1. function changeStyleTheme(cssFile){
  2.    var oldlink = document.getElementById('theme');
  3.  
  4.    var newlink = document.createElement("link");
  5.    newlink.setAttribute("rel", "stylesheet");
  6.    newlink.setAttribute("type", "text/css");
  7.    newlink.setAttribute("id", 'theme');
  8.    newlink.setAttribute("href", cssFile);
  9.  
  10.    oldlink.parentNode.replaceChild(newlink, oldlink);
  11. };