Introduction to the DOM and Dynamic Manipulation

Introduction

When a browser loads an HTML file, it does not simply display the markup — it builds an in-memory model of the page called the Document Object Model, or DOM. The DOM represents every element, attribute, and piece of text as a node in a tree, and it exposes those nodes to JavaScript as objects with properties and methods. This is what makes a page programmable: once the tree exists, your code can find a node, read it, change it, add new nodes, or delete them, and the browser immediately re-renders the result.

This topic is the foundation for everything else in Module 12. Before you can create elements with createElement(), restyle them through classList, or wire up event listeners, you need a clear mental picture of the tree and of how JavaScript reaches into it. You will also want to be comfortable with the distinction between a static page (HTML as authored and served) and a dynamic page (HTML as modified at runtime by script), because that distinction explains why the DOM — not your source file — is the thing you are actually manipulating.

As you watch, look for three things. First, how the presenter maps HTML markup onto tree nodes — parent, child, and sibling relationships. Second, which methods are used to select elements (getElementById, querySelector, querySelectorAll, and the older collection-returning methods) and what each one actually returns. Third, how content is read and written through properties such as textContent, innerText, and innerHTML, and what the practical differences between them are. Keep your browser's developer console open and try each selection and modification yourself on a small test page.

Video 1: Document Object Model in JavaScript | Sigma Web Development Course - Tutorial #66

CodeWithHarry · 8:51 · 346,752 views · 2y ago · captions — Watch on YouTube

About this video

Part of CodeWithHarry's Sigma Web Development course, this tutorial introduces the DOM from a JavaScript programmer's point of view. Based on its placement in the series, it likely covers the document object, how the browser exposes page elements to script, and basic ways to reach and change those elements in code. It is a compact, hands-on introduction at under nine minutes.

Why this video

It connects the abstract idea of the DOM to actual JavaScript code, supporting the 'Accessing Elements with JavaScript' and 'Role of JavaScript at Runtime' subtopics, and it comes from a widely used, well-structured web development course playlist.

Video 2: What is DOM | Document Object Model | Beginner Tutorial

Automation Step by Step · 6:58 · 561,850 views · 5y ago · captions — Watch on YouTube

About this video

A beginner-oriented explanation of what the Document Object Model is, why browsers build it, and how it is used. The description indicates the video walks through the concept of the DOM, the motivation for having a programmable page representation, and a short demonstration. Expect conceptual grounding rather than heavy coding.

Why this video

It is the best starting point for the subtopics 'What is the DOM?' and 'The DOM as a Programmable Interface,' since it defines the model before any JavaScript syntax is introduced, and Automation Step by Step is a long-running channel known for slow, clear beginner explanations.

Video 3: JavaScript DOM - Children, Parent & Sibling Nodes | Sigma Web Development Course - Tutorial #67

CodeWithHarry · 18:56 · 342,668 views · 2y ago · captions — Watch on YouTube

About this video

The follow-up tutorial in the same Sigma series, focused on navigating the DOM tree through children, parent, and sibling nodes. At nearly nineteen minutes it has room to demonstrate the relationship properties that let you move from one node to another rather than selecting each element directly. Expect live code examples against a sample page.

Why this video

This is the most direct coverage of 'The DOM Tree Structure' subtopic, since it treats the page explicitly as a hierarchy of related nodes — exactly the mental model you need before inserting or removing elements later in the module.

How These Videos Support the Learning Outcomes

Together these three videos build the conceptual and practical base for MO1: the first defines the DOM as a programmable interface, the second shows JavaScript reaching into it at runtime, and the third makes the tree structure and its parent, child, and sibling relationships concrete. That same tree understanding is a prerequisite for MO2 and MO3, because createElement(), appendChild(), insertBefore(), and remove() all operate on node relationships, and textContent, innerText, and innerHTML all read or rewrite node content. While these introductory videos do not themselves cover event listeners (MO4) or a full interactive control (MO5), they establish the element-selection and content-modification skills that those later outcomes depend on.

About These Videos

These videos were chosen from YouTube on October 3, 2026. Each has captions; the player turns them on. Videos on YouTube can be changed or removed — if one no longer plays, tell your instructor. If a player does not appear, use its Watch on YouTube link.