第一步:在连接样式表的元素里定义一个id,例如 代码如下:<link href=”1.css” rel=”stylesheet” type=”text/css” id=”css”>,我定义的id是css。 第二步:写一个js函数,代码如下: 代码如下:[removed] function change(a){ var css=document.getElementById(“css”); if (a==1) css.setAttribute(“href”,”1.css”); if (a==2) css.setAttr