<link id=”link” rel=”stylesheet” src=”css1.css” />给link加ID
Function skin1(){
Var link = document.getElementById(“link”);
Link.href=”css1.css”
}
Function skin2(){
Var link = document.getElementById(“link”);
Link.href=”css2.css”
}
然后在给div分别加上onclick事件
转载于:https://www.cnblogs.com/jlliu/p/5317318.html