I am making a countdown timer with JavaScript.
Here is my script.
var seconds_left = 10;
var interval = setInterval(function() {
document.getElementB
document.getElementById('timer_div').innerHTML = "You are Ready!";
var seconds_left = 10;
var interval = setInterval(function() {
document.getElementById('timer_div').innerHTML = --seconds_left;
if (seconds_left <= 0)
{
document.getElementById('timer_div').innerHTML = 'You are ready';
clearInterval(interval);
}
}, 1000);
Here is the Example
<script>
TargetDate = "12/31/2020 5:00 AM";
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";
</script>
<script src="//scripts.hashemian.com/js/countdown.js"></script>