function countdown()
{
seconds = 1000;
delay = delay-seconds;
conversion = Math.ceil(delay / seconds );
document.getElementById('timer').innerHTML = conversion + ":seconds until alarm goes off";
t3 = setTimeout("countdown()",1000);
if(conversion == 0)
{
alert('Wake UP!!!');
DontDoIt();
}
}
This code displays the timer in seconds. I want to be able to show the time in minutes and seconds if the time is greater than 60.
I want to be able to do this with hours, minutes, and seconds
This should solve the problem for you
If needed it displays hours, minutes (with a leading zero) and seconds