<aside> 💡 When the user clicks, start the countdown from 10 to 0 for the 1st pose picture

</aside>

Notes

setInterval() can be a bit funky in the global window object. So I've used 3 separate functions for each of the

Code

  1. The DOM element wherein the countdown will be displayed
<h1 id='timerText'class="text-center my-5"></h1>
  1. Global variable assigned to the number 10 for the 1st countdown
let count1 = 10;
function countdown1() {
document.getElementById('snap').disabled = true
var timer1 = setInterval(function() {
if (count1 < 0) {
clearInterval(timer1);
document.getElementById('timerText').innerHTML = 'Next Pose';
func()
} else {
document.getElementById('timerText').innerHTML = count1
console.log(count1);
count1--
}
}, 1000)
}
  1. countdown1()