天天看点

jetBrains webstorm 时间表格

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #clock{
            width: 200px;
            margin: 100px;
            font-size: 50px;
            color: #0000FF;
            letter-spacing: 3px;
            text-shadow: 5px 5px 5px #;
        }
    </style>
</head>
<body>
    <div id="clock">
    </div>
    <script>

        function showTime() {
            var now =new  Date();
            var hour = now.getHours();
            var minute =now.getMinutes();
            var second = now.getSeconds();
            if(hour<10) hour="0"+hour;
            if(minute<10) minute ="0"+minute;
            if(second<10) second="0"+second;
            var time =hour + ":" + minute + ":" +second;
            document.getElementById("clock").innerHTML = time;
        }
        showTime();
        setInterval(showTime,1000);
    </script>
</body>
</html>