1. Add the following code to Copy the code The code is as follows: <br>var timerID = null; <br>var timerRunning = false; <br>function stopclock (){ <br>if(timerRunning) <br>clearTimeout(timerID); <br>timerRunning = false;} <br>function startclock () { <br>stopclock(); <br>showtime();} <br>function showtime () { <br>var now = new Date(); <br>var hours = now.getHours(); <br>var minutes = now.getMinutes(); <br>var seconds = now.getSeconds() <br>var timeValue = "" ((hours >= 12 ) ? "PM" : "AM" ) <br>timeValue = ((hours >12) ? hours -12 :hours) <br>timeValue = ((minutes < 10) ? ":0" : ":" ) minutes <BR>timeValue = ((seconds < 10) ? ":0" : ":") seconds <BR>document.clock.thetime.value = timeValue; <BR>timerID = setTimeout("showtime()" ,1000); <BR>timerRunning = true;} <BR> 2. Add the following code to onload=startclock() 3. Insert the following code where the time is displayed. It is recommended to use table positioning [code] //Function that only gets the current system date <br>document.write(new Date().getYear() "-" (new Date().getMonth() 1) "-" new Date().getDate()); <br>< ;/script><br><a href="http://www.jb51.net/article/12786.htm">http://www.jb51.net/article/12786.htm</a>