码迷,mamicode.com
首页 > Web开发 > 详细

10.网页时钟

时间:2017-11-20 21:43:16      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:public   val   back   nal   round   string   asc   col   oca   

 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 2 "http://www.w3.org/TR/html4/loose.dtd">
 3 <html>
 4 <head>
 5 <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
 6 <title>网页时钟</title>
 7 <script type="text/javascript">
 8 
 9     function displayTime(){
10 
11         var timeDiv=document.getElementById("timeDiv");
12         var nowTime=new Date();
13         var strnowTime=nowTime.toLocaleString();
14         
15         timeDiv.innerHTML=strnowTime;    
16     
17     }
18     
19     function start(){
20     
21         window.setInterval("displayTime()",1000);
22     
23     }
24     
25 
26 </script>
27 </head>
28 <body onload="start()">
29 
30     <div id="timeDiv"></div>
31 
32 </body>
33 </html>

 

10.网页时钟

标签:public   val   back   nal   round   string   asc   col   oca   

原文地址:http://www.cnblogs.com/xuzhiyuan/p/7868033.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!