Jscript 03 改变网页皮肤颜色

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>改变网页皮肤</title>
</head>
<body>
  <button value="设为红色"  onclick="color('red')">设为红色</button>
  <button value="设为黄色"  onclick="color('yellow')">设为黄色</button>
  <button value="设为蓝色"  onclick="color('blue')">设为蓝色</button>
  <button value="设为绿色"  onclick="color('green')">设为绿色</button>
  
  <script type="text/javascript">
    function color(e){
      document.body.style.backgroundColor = e
    }
  </script>
</body>
</html>

在这里插入图片描述在这里插入图片描述

发布了31 篇原创文章 · 获赞 3 · 访问量 1141

猜你喜欢

转载自blog.csdn.net/Beyond_Nothing/article/details/105634029
03