Double digit 30 seconds countdown

This is how you can proceed: <script type=”text/javascript”> var timeleft = 30; var downloadTimer = setInterval(function(){ timeleft–; document.getElementById(“countdowntimer”).textContent = “:” + ((timeleft >= 10) ? timeleft : (“0” + timeleft)); if(timeleft <= 0){ clearInterval(downloadTimer); window.location.replace(“next_slide.html”); } },1000); </script>

Creating simple countdowns in javascript

You can use Javascript to do that: <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <title>Welcome to My Page!</title> </head> <body> <div id=”about-me”></div> </body> <script> function get_message() { var my_birthday = new Date(“2/13/1996”); // update your birthday here var today = new Date(); var time_diff = Math.abs(today.getTime() – my_birthday.getTime()); // get the difference in milliseconds between … Read more