您好,欢迎访问一九零五行业门户网

JavaScript实现钟表

[html] 
<html> <head> <script type="text/javascript"> function starttime() { var today=new date() var h=today.gethours() var m=today.getminutes() var s=today.getseconds() // add a zero in front of numbers<10 m=checktime(m) s=checktime(s) document.getelementbyid('txt').innerhtml=h+":"+m+":"+s t=settimeout('starttime()',500) } function checktime(i) { if (i<10) {i="0" + i} return i } </script> </head> <body onload="starttime()"> <div id="txt"></div> </body> </html>
其它类似信息

推荐信息