const timeElement = document.querySelector('.time');
const tick = () => {
const now = new Date();
const hours = now.getHours();
const min = now.getMinutes();
const sec = now.getSeconds();
timeElement.textContent = `${hours}:${min}:${sec}`;
}
tick();
setInterval(tick, 1000);