Level 3 · Interactive Web Applications
Module 11: The Document Object Model
Understanding the DOM tree
Describe the DOM as a tree of nodes, move between parents, children and siblings, and tell element nodes from text nodes.
Lesson 52
Selecting elements
Select elements with getElementById, querySelector and querySelectorAll using CSS selectors, handle missing elements, and search inside a container.
Lesson 53
Reading and changing content
Read and change element text with textContent, read input values, understand when innerHTML is appropriate, and avoid injecting untrusted HTML.
Lesson 54
Creating and removing elements
Create elements with createElement, insert them with append, prepend, before and after, remove them, re-render lists from data, and clone templates.
Lesson 55
Updating styles, attributes and classes
Add, remove and toggle classes, read and set attributes and data-* values, set inline styles sparingly, and keep ARIA attributes in sync with the visual state.
Module mastery assessment
Eight questions and a browser practical covering Lessons 51 to 55: the DOM tree, selecting elements, changing content, creating and removing elements, and attributes and classes.