<div class="codetitle"> <span><a style="CURSOR: pointer" data="62702" class="copybut" id="copybut62702" onclick="doCopy('code62702')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code62702"> <br> <br> <br><script type="text/javascript"> <BR>function startTime() <BR>{ <BR>var today=new Date() <BR>var h=today.getHours() <BR>var m=today.getMinutes() <BR>var s=today.getSeconds() <BR>// add a zero in front of numbers<10 <BR>m=checkTime(m) <BR>s=checkTime(s) <BR>document.getElementById('txt').innerHTML=h+":"+m+":"+s <BR>t=setTimeout('startTime()',500) <BR>} <BR>function checkTime(i) <BR>{ <BR>if (i<10) <BR>{i="0" + i} <BR>return i <BR>} <BR></script> <br> <br> <br><div id="txt"></div> <br> <br> <br> </div> <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="54416" class="copybut" id="copybut54416" onclick="doCopy('code54416')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code54416"> <br><script type="text/javascript"> <BR>var d=new Date() <BR>var weekday=new Array(7) <BR>weekday[0]="星期日" <BR>weekday[1]="星期一" <BR>weekday[2]="星期二" <BR>weekday[3]="星期三" <BR>weekday[4]="星期四" <BR>weekday[5]="星期五" <BR>weekday[6]="星期六" <BR>document.write("今天是" + weekday[d.getDay()]) <BR></script> <br> </div>