Tip: You can modify some of the code before running
<! DOCTYPE html> <ptml> <pead> <meta charset= "Utf-8"/> <title> countdown </title> </pead> <body> <div> countdown: <span id= "test" ></span> </div> <script type= "Text/ja Vascript "> (function () {var date=new date (2011,1,2,23,59,59),//After New Year's Eve is not next year, so this time is to February 2, 2011 23:59 59 Second time, showdate = function () {if (Date.gettime ()-new date (). GetTime () <= 0) { Clearinterval (time); document.getElementById ("Test"). Innerhtml= "Closed"; Return var now = new Date (), jsd = Date.gettime ()-now.gettime (), hour = Math.fl Oor (jsd/(60*60*1000)), minute = Math.floor (jsd/(60*1000))-hour*60, second = Math.floor (j sd/1000)-minute*60-hour*60*60; Hour = Hour < 10? ("0" + hour): hour; MinuTe = minute < 10? ("0" + minute): minute; Second = Second < 10? ("0" + second): second; document.getElementById ("Test"). InnerHTML = hour + "hours" + Minute + "min" + second + "seconds"; };showdate (); Time=window.setinterval (showdate,1000); })(); </script> </body> </ptml></td> </tr> </table>
Tip: You can modify some of the code before running