码迷,mamicode.com
首页 > Web开发 > 详细

js网页换肤

时间:2016-09-30 12:00:06      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:

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

<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网页换肤

标签:

原文地址:http://www.cnblogs.com/Yimi/p/5923129.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!