Please Login or Register to continue.


How can the timer be coded to reset automatically after 30 seconds and repeat the countdown?
(210 Points)
in PHP


1 Answer
(9.4K Points)

I commented and suggested using a meta refresh to reset the countdown timer automatically. When countdown timer time ended then meta refresh reshes the whole page and the countdown timer starts from 30 seconds. This process will continue again and again and never stop. It's a method to reset the countdown clock timer using Meta refresh and also you can set any value using PHP programming. 

<!DOCTYPE html>
<title> Refresh countdown timer automatically</title>
function countDown(secs,elem) {
var element = document.getElementById(elem);
element.innerHTML = "Timer: "+secs+" seconds";
if(secs < 1) {
element.innerHTML += '<meta http-equiv="refresh" content="0; url= ">';
var timer = setTimeout('countDown('+secs+',"'+elem+'")',1000);
<div id="status"style="font-size:30px;"></div>

<script> countDown(<?php echo $phpvar; ?>,"status");</script>




Related Questions :-

Featured Items:-

Certificate system in PHP website | PHP scripts


Home Credito loan finance management multipurpose system in PHP


Result management system with Marksheet in PHP website | PHP Scripts


Your Answer

You can post your answer after login..