19 lines
360 B
JavaScript
19 lines
360 B
JavaScript
function updateClock() {
|
|
const clock = document.getElementById('liveClock');
|
|
|
|
if (!clock) {
|
|
return;
|
|
}
|
|
|
|
clock.textContent = new Date().toLocaleTimeString('de-AT', {
|
|
hour: '2-digit',
|
|
minute: '2-digit',
|
|
second: '2-digit'
|
|
});
|
|
}
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
updateClock();
|
|
setInterval(updateClock, 1000);
|
|
});
|