11th Oct 2017, 10:15 AM
ARB
ARB - avatar
2 Answers
+ 3
Use setInterval and clearInterval for timer counting, setTimeout only run once. Try this: var count, countNumber; function start(){ countNumber = 11; count = setInterval(countTrigger, 1000); } function countTrigger(){ if(countNumber > 0){ countNumber-- ; document.getElementById("arb").innerHTML = countNumber ; } } function stop(){ clearTimeout(count); }
11th Oct 2017, 10:32 AM
CalviŐ˛
CalviŐ˛ - avatar
+ 2
@Calvin thanks
11th Oct 2017, 10:52 AM
ARB
ARB - avatar