Introducing the DOM

Introducing the DOM: Introducing the DOM: an overview, Locating DOM elements.

Updated

  1. Introducing the DOM: an overview (Novice): When the browser loads a page, it turns the HTML into the DOM, a tree of objects with one for each element, and JavaScript reads and changes the page through that tree.
  2. Locating DOM elements (Apprentice): Most searches start at the document, the whole page, where getElementById finds an element by its id, querySelector finds the first match for a CSS selector, and querySelectorAll finds every match.