<! DocType html> <html> <head> <meta charset = "utf-8"> <title> 简单易用的倒计时 js 代码 </title> <style>*{margin: 0; relleno: 0; Estilo de lista: Ninguno;} cuerpo {Font-size: 18px; Text-Align: Center;}. Tiempo {altura: 30px; relleno: 200px;} </style> </head> <body> <viv> <span id = "t_d"> 00 天 </span> <span id = "t_h"> 00 时 </span> <span id = "t_m"> 00 00 分 </span> <span id = "t_s"> 00 秒 </span> </iv> <script> function getrtime () Fecha ('2014/09/20 00:00:00'); var nowtime = new Date (); var t = endtime.gettime () - nowtime.gettime (); var d = 0; var h = 0; var m = 0; var s = 0; if (t> = 0) {d = Math.floor (t/1000/60/60/24); H = Math.floor (t/1000/60/60%24); M = Math.floor (t/1000/60%60); s = Math.floor (t/1000%60); } document.getElementById ("t_d"). innerhtml = d + "天"; document.getElementById ("t_h"). innerhtml = h + "时"; document.getElementById ("t_m"). innerhtml = m + "分"; document.getElementById ("t_s"). innerhtml = s + "秒"; } setInterval (getrtime, 0); </script> </body> </html>