Intern Track Roadmap

DOM basics

This course explains the DOM, the live tree of objects a browser builds from the HTML text a Rails app sends. It covers element, text and comment nodes, family terms such as parent and descendant, and the document root. It shows how to inspect the tree with DevTools. It explains how CSS selectors and combinators match nodes. It also shows how JavaScript and Turbo change the tree after load. Last, it defines the render tree, reflow, repaint, virtual DOM and Shadow DOM, and reads a small product card step by step.

What you'll learn

  • ✓How the HTML text a server sends differs from the DOM tree the browser builds
  • ✓Node types, tree relationships and the document root
  • ✓Reading and temporarily editing the live DOM in DevTools
  • ✓How CSS selectors, combinators and querySelector match nodes in the tree
  • ✓Changing the DOM with createElement, appendChild, textContent and remove, and how Turbo Drive and Turbo Frames update it
  • ✓What the render tree, reflow, repaint, virtual DOM and Shadow DOM mean
Free preview · Lesson 1 3 min read

What is the DOM, really?

Start with a fact about every page a Rails app serves. The HTML your server sends over the network is just text, a string of characters like any other file. When a browser receives that text, it builds something else from it: a live, in-memory tree of objects called the DOM (Document Object Model).…

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...