<!DOCTYPE HTML><HTML><Head><Metahttp-equiv= "Content-type"content= "Text/html;charset=utf-8" /> <title>Countdown to the Juniors</title></Head><Body><Div>From the end of the junior period July 1, 2015 only:<spanID= "Othertime"></span></Div><Scripttype= "Text/javascript"> varObjelem=document.getElementById ("Othertime"); varEndTime= NewDate (' -', '7', '1'). GetTime (); varNowtime= NULL; varLavetimer= NULL; functionLavetime () {nowtime= NewDate (). GetTime (); vara=EndTime-Nowtime;//the number of milliseconds before the specified time is reached: if(A> 0) { vararr_1= [ +* -* -* -, +* -* -, +* -, +], arr_2= ['days', 'hours', 'points', 'seconds'], temp= NULL; varTimedesarr= []; for (varI= 0, Len=arr_1.length; I<Len; I++) {Temp=Math.floor (A/arr_1[i]); if(Temp> 0) {Timedesarr.push (String (temp). Length== 1 ? ("xx"+temp). substr (1): Temp)+Arr_2[i]); } A-=Arr_1[i]*temp; } objelem.innerhtml=Timedesarr.join (""); } Else{objelem.innerhtml= "It's time to go! "; Clearinterval (Lavetime); Lavetime= NULL; } } //because our time is one second in a second, then it will take one second to change the rest of the time, one second to execute the Lavetime functionLavetimer=setinterval (Lavetime,1* +);</Script></Body></HTML>
as follows:
JavaScript implementation Countdown