#1 時間顯示 - 蛙 (Administrator) 發表於 18-5-2012 18:22
<DIV id=postmessage_42196 class=t_msgfont><FONT size=3><FONT color=#0000ff>如不能顯示語法效果,可貼去本站</FONT></FONT><A href="http://www.bunbun000.com/html/index.htm" target=_blank><FONT size=3><FONT color=red>語法測試板</FONT></FONT></A><FONT size=3><FONT color=#0000ff>試看</FONT></FONT><BR><FONT size=3><FONT color=#0000ff></FONT></FONT><BR><FONT size=3><FONT color=#0000ff></FONT></FONT><BR><FONT size=3><FONT color=#0000ff></FONT></FONT><BR><BR><BR><BR><BR><FONT size=2><FONT color=#0000ff><center> <script language="JavaScript">document.write("<span id='clock'></span>"
;<BR>var now,hours,minutes,seconds,timeValue; function showtime(){ now = new Date(); <BR>hours = now.getHours(); minutes = now.getMinutes(); seconds = now.getSeconds(); <BR>timeValue = (hours >= 12) ? "下午 " : "上午 "; timeValue += ((hours > 12) ? hours - 12 : hours) + " 時"; <BR>timeValue += ((minutes < 10) ? " 0" : " "
+ minutes + " 分";<BR>timeValue += ((seconds < 10) ? " 0" : " "
+ seconds + " 秒";<BR>clock.innerHTML = timeValue; setTimeout("showtime()",100); }<BR>showtime();</script> </center></FONT></FONT></DIV>