Countdown timer javascript code countdown timer javascript code <script type = "text/javascript"> /*author Philip M. 2010*/ var timeInSecs; var ticker; function startTimer(secs){ timeInSecs = parseInt(secs)-1; ticker = setInterval("tick()",1000); // every second } function tick() { var secs = timeInSecs; if (secs>0) { timeInSecs--; } else { clearInterval(ticker); // stop counting at zero // startTimer(60); // remove forward slashes in front of startTimer to repeat if required } document.getElementById("countdown").innerHTML = secs; } startTimer(60); // 60 seconds </script> <span id="countdown" style="font-weight: bold;">60</span> From JR's : articles 76 words - 612 chars created on Mar 01, 2016 at 06:28:54 pm - # source - versions