首页 > 代码库 > js网页换肤

js网页换肤

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

<html>  <head>  <meta charset="utf-8">    <meta name="generator"    content="HTML Tidy for HTML5 (experimental) for Windows https://github.com/w3c/tidy-html5/tree/c63cc39" />    <title>网页换肤</title>   <link id="ly" rel="stylesheet" type="text/css" href="css1.css">   <script>  function skin1(){    var oL=document.getElementById(ly);    oL.href=css1.css;}function skin2(){    var oL=document.getElementById(ly);    oL.href=css2.css;}    </script>  </head>  <body>  <input type="button" value="黄" onclick="skin1()"/>  <input type="button" value="粉" onclick="skin2()"/>  </body></html>

body{background:#FFD39B;}input{width:25px;height:25px;background:yellow;}

body{background:pink;}input{width:25px;height:25px;background:red;}

技术分享

 

技术分享

 

js网页换肤