const second = document.getElementById('second');
const button = document.getElementById('btn');
let num = 0;
let intervalId;
button.addEventListener('click', () => {
if (intervalId) return;
intervalId = setInterval(() => {
num++;
if (num > 59) {
num = 0;
}
second.innerHTML = num > 9 ? num : `0${num}`;
}, 1000);
});