当前位置 博文首页 > 文章内容

    aqianggeyo的博客:1024程序员节,心想事橙无BUG!

    作者:21344 栏目:未分类 时间:2021-11-25 22:41:35

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>1024</title>
    </head>
    <body>
    <div id="happyDay">
        1024程序员节,心想事成无BUG!
    </div>
    <script>
        var hd = document.getElementById('happyDay');
    function randomColor(){
        var arr = ['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'];
        var str ="#";
        for (var i = 1; i<=6; i++){
            var index = Math.floor(Math.random()*16);
                str += arr[index];
        };
        return str;
    };
    setInterval(function (){
         Colr =randomColor();
         hd.style.color = Colr;
    },1024);
    </script>
    </body>
    </html>

    cs