Home / Web basics / Behavior

The DOM

The DOM is the page as objects that JavaScript can read and change. Find an element, then edit it. The elements come from HTML.

const h = document.querySelector("h1");
h.textContent = "Changed!";

Test yourself on this