A
A
Anton2019-03-09 14:37:23
JavaScript
Anton, 2019-03-09 14:37:23

1 minute countdown timer with reboot at the end how?

Hello! Tell me or give examples of the simplest countdown timer of 1 minute, after which the page will simply reload, Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Talyan, 2019-03-09
@boypush

<META HTTP-EQUIV="REFRESH" CONTENT="N;URL=адрес">
N - time in seconds (integer)
URL - document address (optional)
And yes, if you couldn't google it yourself, it's better to remove the signature "webmaster" under your nickname.
A timer that shows the time until the end - just as easy to google, but even faster to do it yourself

<span id="timer">60</span>

<script>
function tiktak()
{
let timer=document.getElementById("timer");
let secs=timer.innerHTML;
--secs;
timer.innerHTML=secs;
if(secs==0)
{
document.location.reload();
}


}
document.addEventListener('DOMContentLoaded', function(){

setInterval(tiktak,1000);
});
</script>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question