document.addEventListener("DOMContentLoaded", function () { const button = document.getElementById("passwordButton"); if (button) { button.addEventListener("click", function () { const password = document.getElementById("passwordButton").value; if (password === "mySecret123") { window.location.href = "secret.html"; } else { alert("Incorrect password"); } }); } });