Un bon compte à rebours de la page HTML peut être exact en secondes, ce qui est simple, mais pratique
<! doctype html> <html> <éadf> <meta charset = "utf-8"> </ head> <body> <div id = "countmsg"> <span id = "t_d"> 00 jours </span> <span id = "t_h"> 00 heures <pan> <span id = "t_m"> 00 Minutes </pank> <pank id = "T_> 00" secondes </span> </ div> <script type = "text / javascript"> function getrtime () {var endtime = new Date ('2014/10/23 10:00:00'); // Deadline var nowtime = new Date (); var t = endtime.getTime () - maintenantTime.getTime (); / * var d = math.floor (t / 1000/60/60/24); t- = d * (1000 * 60 * 60 * 24); var h = math.floor (t / 1000/60/60); t- = h * 60 * 60 * 1000; var m = math.floor (t / 1000/60/60); t- = m * 60 * 1000; var s = math.floor (t / 1000); * / var d = math.floor (t / 1000/60/60/24); var h = math.floor (t / 1000/60/60% 24); var m = math.floor (t / 1000/60% 60); var s = math.floor (t / 1000% 60); document.getElementById ("t_d"). innerHtml = d + "jour"; document.getElementById ("t_h"). innerhtml = h + "time"; document.getElementById ("t_m"). innerHtml = m + "minutes"; document.getElementById ("t_s"). innerHtml = s + "secondes"; } setInterval (getrtime, 1000); </cript> </ body> </html>