JavaScriptHTML + CSS + JavaScript
Draft saved locallyJavaScript · Spaces: 2
Live preview move your pointer inside
Mission 01 10 min
Reward+100 XP

JavaScript Meets the Page

The browser turns your HTML into a live page called the DOM. JavaScript can find an element and change it.

const message = document.querySelector("#message");

message.textContent = "New words";
  • document.querySelector(...) finds the first matching element.
  • #message means “the element whose ID is message”.
  • textContent is the text inside that element.

Learn more

01
Your mission

Change the message paragraph from JavaScript when the page runs.

  • Create a constant named message that selects #message.
  • Set message.textContent to exactly Magic activated! ✨.
Check my work Run project
Mission demoJavaScript Meets the Page

Finished result only — the answer code stays hidden.