I am working on a personal project to create a pomodoro clock. I am starting off by trying to create a 25 minute countdown timer with a start and stop button. I have included a timer function that should count down my variable every 1000 milliseconds but it does not function. Here is my HTML:
Pomodoro Clock
<div id="timer" class="circle">Timer</div>
<button onclick="setTimeout(timer, 1000);">Start</button>
<button>Stop</button>
Javascript:
var i = 25;
document.getElementById("timer").innerHTML = i;
function timer(){
setInterval(function(){i--}, 1000);
}
I am guessing it may have something to do with my timer function?
innerHTML, usetextContent- Sterling Archer