JavaScript网页换肤

使网页背景颜色可选黄/粉

<!doctype html>
<html>
<head><title>网页换肤</title></head>
<link id="css1" href="5-1.css" type="text/css" rel="stylesheet">

<script>
    function ys1(){
    var a=document.getElementById("css1");
    a.href="5-1.css";
    }
    function ys2(){
    var a=document.getElementById("css1");
    a.href="5-2.css";
    }
</script>
<body>
    <button onclick="ys1();">样式1</button>
    <button  onclick="ys2();">样式2</button>
</body>
</html>

 

posted @ 2016-09-30 10:57  缘琪梦  阅读(196)  评论(0编辑  收藏  举报