JS改变页面颜色

版权声明:转载原创文章请以超链接形式请注明原文章出处,尊重作者,尊重原创!


恰饭广告




<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .big_box{
            width: 500px;
            height: 500px;
            border: 1px solid black;
        }
        .big_box input{
            margin-left: 60px;
        }
    </style>
    <script>
        function Change_red(){
            var Red=document.getElementById("change_style");
            Red.style.backgroundColor="red";
        }
        function Change_blue(){
            var Blue=document.getElementById("change_style");
            Blue.style.backgroundColor="blue";
        }
        function Change_green(){
            var Green=document.getElementById("change_style");
            Green.style.backgroundColor="green";
        }
    </script>
</head>
<body>
    <div class="big_box" id="change_style">
        <input type="button" value="变为红色" onclick="Change_red()">
        <input type="button" value="变为蓝色" onclick="Change_blue()">
        <input type="button" value="变为绿色" onclick="Change_green()">
    </div>
</body>
</html>  

原文链接:https://www.idaobin.com/archives/196.html

让我恰个饭吧.ヘ( ̄ω ̄ヘ)

支付宝 ——————- 微信
图片加载中图片加载中



恰饭广告

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

45 ÷ = 9