The DOM
How JavaScript sees and changes a web page: the DOM tree, finding elements, changing text, classes and styles, building elements and keeping it fast.
Until now your code has mostly talked to the console. This phase connects JavaScript to the page. The browser turns your HTML into a tree of objects called the DOM (Document Object Model), and every change you see on a modern website, from a new chat message to a red error under a form field, is JavaScript changing that tree.
You'll learn what the tree really is (nodes, elements, text and the document object), how to find elements with querySelector and friends, and how to change their text safely (and why innerHTML with user input is a security hole). Then you'll work with attributes, classes, data-* values and styles, including CSS variables, and build, move and remove elements with createElement, append, replaceWith and <template>.
The last two topics go deeper: walking the tree from any element to its parents, children and siblings, and keeping pages fast by understanding reflow (layout) and repaint, batching changes and avoiding layout thrashing. You need Phases 1–7 (especially objects and functions). Phase 9 adds events, so the page can react to clicks and typing. The /html and /css courses explain the markup and styles you'll be changing here.
Practise this phase
Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.