使用JS建立style標籤

var style = document.createElement('style');  style.type = 'text/css';  style.innerHTML="body{ background-color:blue }";  document.getElementsByTagName('head').item(0).appendChild(style); 
相關文章
相關標籤/搜索