var link = document.createElement("link");
link.setAttribute("rel", "stylesheet");
link.setAttribute("name", "xxx");
link.setAttribute("href", "...");
document.querySelector("head").appendChild(link);
var link = document.createElement("link");
link.setAttribute("rel", "stylesheet");
link.setAttribute("name", "xxx");
link.setAttribute("href", "...");
document.querySelector("head").appendChild(link);
本文标题:JS动态添加css
本文链接:https://www.haomeiwen.com/subject/bgugxqtx.html
网友评论