A notice card carries a small bit of state in data-status. Read it in JavaScript to choose the message shown on the page.
An HTML data-status attribute appears as element.dataset.status, a string. For multiword names, data-session-state becomes dataset.sessionState. A condition can compare that string and write one of two messages with textContent. dataset is for page metadata, not a secret store or a substitute for validated application data.
In script.js, this is the important part of the already-working preview:
const gardenCard = document.querySelector("#garden-card");
const gardenMessage = document.querySelector("#garden-message");
if (gardenCard.dataset.status === "open") {
gardenMessage.textContent = "Garden visits are open today.";
} else {
gardenMessage.textContent = "Garden visits are closed today.";
}
The preview reports that visits are open. Change data-status in index.html to closed and Run: the other branch appears. Restore open to see the first branch again.
Which JavaScript name corresponds to data-session-state? dataset.sessionState. Recall that dataset values are strings, so compare with "open", not a boolean.
The next lesson gives you a different page to build from a starter.