const button = document.querySelector("#show-message"); const status = document.querySelector("#script-status"); const output = document.querySelector("#message-output"); const log = document.querySelector("#script-log"); if (!button || !status || !output || !log) { throw new Error("The HTML elements for the script demo were not found."); } status.textContent = "app.js loaded with defer."; button.dataset.ready = "true"; log.textContent = "app.js selected the button and status elements."; button.addEventListener("click", () => { output.textContent = "Loaded app.js and handled the click."; log.textContent = "click handler ran from app.js"; });