25 lines
733 B
JavaScript
25 lines
733 B
JavaScript
/**
|
|
* DPW PKS Jambi Portal - Main JavaScript
|
|
*/
|
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
|
|
// Real-time Clock
|
|
const clockElement = document.getElementById('real-time-clock');
|
|
|
|
function updateClock() {
|
|
if (clockElement) {
|
|
const now = new Date();
|
|
const hours = String(now.getHours()).padStart(2, '0');
|
|
const minutes = String(now.getMinutes()).padStart(2, '0');
|
|
const seconds = String(now.getSeconds()).padStart(2, '0');
|
|
clockElement.textContent = `${hours}:${minutes}:${seconds}`;
|
|
}
|
|
}
|
|
|
|
if (clockElement) {
|
|
updateClock(); // Initial call
|
|
setInterval(updateClock, 1000); // Update every second
|
|
}
|
|
|
|
}); |