美文网首页
简单数字时钟

简单数字时钟

作者: 貳條 | 来源:发表于2020-04-03 22:49 被阅读0次
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>exam time</title>
    <style>
    .time { font-size: 300pt; line-height: 200%; color:b;}
    </style>
    <script type="text/javascript">
    var getObj = function(id){
        if(!id){
            return false;
        }
        return document.getElementById(id);
    };
    <!-- Hiding
    var ctimer;
    
    function settimes(){
    
    var time= new Date();
    hours= time.getHours();
    mins= time.getMinutes();
    secs= time.getSeconds();
    if (hours<10)
    hours="0"+hours;
    if(mins<10)
    mins="0"+mins;
    if (secs<10)
    secs="0"+secs;
    getObj('tim1').innerHTML=hours+":"+mins+":"+secs
    ctimer=setTimeout('settimes()',960);
    }
    // Done hiding -->
    </script>
    <title>js data clock</title>
    </head>
    <body onload="settimes()">
    <!---->
    <!--<div class=time id=tim1 style="height: 500px; left: 300px; position: absolute; top: 100px; width: 500px"></div>-->
    <div class=time id=tim1 style="text-align:center"></div>
    </body>
    </html>
    
    

    相关文章

      网友评论

          本文标题:简单数字时钟

          本文链接:https://www.haomeiwen.com/subject/xvnlphtx.html