想做一个按钮,可以实现点击后在两套css之间来回切换,但是没有效果,代码如下: <!doctype html> <html> <head> <meta charset="utf-8"> <title>1</title> <link rel="stylesheet" type="text/css" href="skin1.css" id="skin"> <script> function change() { var skintype=document.getElementById("skin"); if (skintype.href=="skin1.css") { skintype.href="skin2.css"; } else{ skintype.href="skin1.css"; } } </script> </head> <body> <p> <input type="button" value="切换" onclick="change();"> </p> </body> </html>
woshiajuana
蜂之谷
相关分类