Understand the web. Build it yourself.

All repair missions / Mission 07

Fix this page

Reconnect the button

Repair the HTML target used by a supplied JavaScript listener.

Your goal

The supplied listener looks for #open-notes. Repair the button id, then update the preview and activate the button. The notes should read “Notes are open.” Keep the original button text. The JavaScript is supplied by the workshop, not evaluated from your editor.

Read one possible solution
HTML · EXAMPLE
<h2>A tiny interaction</h2><button id="open-notes">Show notes</button><p id="notes">Notes are closed.</p>
CSS · EXAMPLE
button { padding: 12px; background: #423025; }

A selector that matches no element attaches no listener here because optional chaining stops the call. The workshop installs the shown listener into the restricted preview; arbitrary edited JavaScript is not executed.

Starting code and all hints
HTML · EXAMPLE
<h2>A tiny interaction</h2><button id="show-notes">Show notes</button><p id="notes">Notes are closed.</p>
CSS · EXAMPLE
button { padding: 12px; background: #423025; }
  1. The supplied script uses document.querySelector("#open-notes")?.addEventListener("click", () => { document.querySelector("#notes").textContent = "Notes are open."; });
  2. Compare the selector with the button id.
  3. Change show-notes to open-notes, update the preview, then click the button.

Read the related guide →

Original missions by Mario V.W.B.R. Obst with AI assistance · September–November 2026.