A neighbourhood guide has a link that starts as a placeholder. Give the link a real destination and a meaningful accessible label, then remove a no-longer-needed marker.
getAttribute(name) returns the stored attribute string or null when absent. setAttribute(name, value) creates or replaces an attribute. removeAttribute(name) deletes it. An anchor needs a real href; its visible wording should identify the destination. aria-label is useful when the visible label is too short, but it should also name the destination clearly. Never replace a descriptive visible label with vague “click here.”
In script.js, this is the important part of the already-working preview:
const trailLink = document.querySelector("#trail-link");
const linkStatus = document.querySelector("#link-status");
const previousDestination = trailLink.getAttribute("href");
trailLink.setAttribute("href", "https://example.org/trails");
trailLink.setAttribute("aria-label", "Explore the local trail map");
trailLink.removeAttribute("data-placeholder");
linkStatus.textContent = `Link moved from ${previousDestination} to ${trailLink.getAttribute("href")}`;
The status reports the old # and new address. Inspect the link: its destination and aria-label changed; data-placeholder is gone. Change the final address, Run, then restore it. You do not need to navigate away.
Recall the three attribute actions: getAttribute reads (or returns null), setAttribute writes, and removeAttribute deletes.
The next lesson gives you a different page to build from a starter.