<! Doctype html> <html> <head> <meta charset = "utf-8"> <Title> 简单易用的倒计时 JS 代码 </title> <style>*{Margin: 0; Заполнение: 0; Список стиля: none;} body {font-size: 18px; Text-align: Center;}. Time {Height: 30px; Подкладка: 200px;} </style> </head> <body> <div> <span id = "t_d"> 00 天 </span> <span id = "t_h"> 00 时 </span> <span id = "t_m"> 00 分 </span> <span = "t_s"> 00 秒 </span> </div> <script> gatertime (var> <) <) <) <) <) <) <). Дата ('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>