A museum display has an expired announcement, a label with the wrong date, and a draft list. Fix the exhibit without rewriting the entire page as HTML.
In the separate recipe example below, the original recipe cards remain in the DOM except for the one deliberately removed or replaced. The replacement is a created element with text set safely. Clearing the scratch parent does not delete the parent itself. Apply those three decisions to the exhibit’s IDs.
// Different example: recipe cards, not the exhibit.
document.querySelector("#old-recipe").remove();
const corrected = document.createElement("li");
corrected.textContent = "Roast for 25 minutes";
document.querySelector("#wrong-step").replaceWith(corrected);
document.querySelector("#recipe-drafts").replaceChildren();
Run the preview: Last month’s tour disappears, Gallery opens at 10 am replaces the old hours in the same spot, and the draft list is blank. Keep the final Sculpture walk item visible.
Earlier, append, prepend, and insertBefore added nodes. Here remove, replaceWith, and replaceChildren cover the opposite direction. Choose the smallest change that matches the job.
#expired from the exhibit list while keeping #exhibits.#old-hours in place with a newly created li whose textContent is Gallery opens at 10 am; preserve Sculpture walk.#drafts without removing that list element or interpreting strings as HTML.replaceChildren() with no arguments empties a parent without deleting it.