There is a timer that appears on the screen after clicking .exitA, 1st button.
I want the timer to start after that button is clicked.
https://jsfiddle.net/87jvr3uh/
Right now, it stops after that button is clicked.
<h2>Click anywhere to stop the timer</h2>
<p id="timer"></p>
<script>
let seconds = 0;
let timerId = setInterval(updateTimer, 100);
function updateTimer() {
seconds += 0.1;
document.getElementById("timer").innerHTML = seconds.toFixed(1) + " seconds";
}
document.body.addEventListener("click", function() {
clearInterval(timerId);
document.getElementById("timer").innerHTML += " (stopped)";
});
</script>
Here is the standalone timer code by itself:
https://jsfiddle.net/o4qLxnr8/2/