Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript countdown 10 seconds

var timeleft = 10;
var downloadTimer = setInterval(function(){
  if(timeleft <= 0){
    clearInterval(downloadTimer);
  }
  document.getElementById("progressBar").value = 10 - timeleft;
  timeleft -= 1;
}, 1000);
<progress value="0" max="10" id="progressBar"></progress>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #countdown #seconds
ADD COMMENT
Topic
Name
6+2 =