<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "UTF-8"> <title></title> </Head> <Scripttype= "text/javascript">window.onload=function(){ //Countdown function functionDJs () {varFur_time=NewDate ( .,5, -,Ten, -,0); //set time May 30, 2017 //Create Current Time varNow_time=NewDate (); //calculate a time difference between two dates vardiff=fur_time.gettime ()-Now_time.gettime (); //Alert (diff); varTian=parseint (diff/(24*60*60*1000));//calculate how many days remaining //gets the number of milliseconds remaining after the calculation of the number of daysdiff=diff%( -* -* -* +); //count hours varXiaoshi=parseint (diff/(60*60*1000)); //number of milliseconds remaining after the hour is calculateddiff=diff%( -* -* +); //get the number of minutes varFenzhong=parseint (diff/(60*1000)); //the number of milliseconds after the number of minutes is calculateddiff=diff%( -* +); //Calculate seconds varMiao=parseint (diff/); //document.write (' The remaining time also ' +tian+ ' Day ' +xiaoshi+ ' hours ' +fenzhong+ ' minutes ' +miao+ ' seconds '); varSS=document.getElementById (' time'). getElementsByTagName ('span'); ss[0].innerhtml=tian; ss[1].innerhtml=xiaoshi; ss[2].innerhtml=fenzhong; ss[3].innerhtml=miao; } DJs (); //Timer for Countdownsetinterval (djs, +); } </Script> <Body> <H2ID= "time">There's still time left.<span>0</span>Days<span>0</span>Hours<span>0</span>Score of<span>0</span>Seconds</H2> </Body></HTML>
JS Page Countdown Effect