JavaScript动态添加CSS
function addCssByStyle(cssString){var doc=document;var style=doc.createElement("style");style.setAttribute("type", "text/css");if(style.styleSheet){// IEstyle.styleSheet.cssText = cssString;} else {// w3cvar cssText = doc.createTextNode(cssString);style.appendChild(cssText);}var heads = doc.getElementsByTagName("head");if(heads.length)heads.appendChild(style);elsedoc.documentElement.appendChild(style);}
页:
[1]