不是原生不发。简单倒计时。见代码
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> .HotDate{height: 50px;width: 250px;margin: 2px auto;background: #666666; } .HotDate span{display: inline-block;padding: 4px;background: #fff;color: #000;font-size: 16px;} </style> </head> <DIV id="CountMsg" class="HotDate"> <span id="t_d">00</span>天 <span id="t_h">00</span>时 <span id="t_m">00</span>分 <span id="t_s">00</span>秒 </DIV> <script type="text/javascript"> function getRTime(){ var EndTime= new Date('2015/11/21 10:30:00'); var NowTime = new Date(); var t =EndTime.getTime() - NowTime.getTime(); if(t < 0){ clearInterval(time1); document.getElementById("CountMsg").innerHTML = "活动已经结束"; }{ 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<10?'0':'') +d ; document.getElementById("t_h").innerHTML = (h<10?'0':'') +h ; document.getElementById("t_m").innerHTML = (m<10?'0':'') +m ; document.getElementById("t_s").innerHTML = (s<10?'0':'') +s ; } } var time1 = setInterval(getRTime,1000); </script> </body> </html>