为什么我的做出来,时间不是一秒一秒的跳的呢?
window.onload=function(){ showTime(); } function showTime(){ var nowtime=new Date(); var endtime=new Date("2016/6/6,12:20:12"); var leftTime=parseInt(endtime.getTime()-nowtime.getTime()); var d=parseInt(leftTime/(24*60*60)); var h=parseInt(leftTime/(60*60)%24); var m=parseInt(leftTime/60%60); var s=parseInt(leftTime%60); document.getElementById("leftTime").innerHTML="还剩"+d+"天"+h+"小时"+m+"分钟"+s+"秒"; setTimeout(showTime,1000) }