This commit is contained in:
2025-07-21 17:00:04 +02:00
parent 16be59d321
commit 01f3de7f3b
4 changed files with 59 additions and 0 deletions

22
html/script.js Normal file
View File

@@ -0,0 +1,22 @@
document.addEventListener("DOMContentLoaded", () => {
const dateElement = document.getElementById("javascriptdate");
function updateDateTime() {
const now = new Date();
dateElement.textContent = `Current date and time: ${now.toLocaleString()}`;
}
// Update once on load
updateDateTime();
// Optional: Update every second
setInterval(updateDateTime, 1000);
// Fun interaction: click the title to change color
const header = document.querySelector(".specialboi");
header.addEventListener("click", () => {
header.style.color = header.style.color === "teal" ? "crimson" : "teal";
});
});
console.log("shit happened");