📘 A practical, hands-on guide to the Document Object Model. Each topic has a short overview, working code you can paste into a browser console or an HTML file, and the pitfalls to avoid.


📑 Index

🏗️ Part 1: Foundations

  1. DOM Tree & DOM Nodes
  2. Selecting DOM Elements
  3. Modifying HTML Content (innerHTML, textContent)
  4. Modifying CSS Styles & Classes
  5. Creating & Removing DOM Elements
  6. DOM Traversal

⚡ Part 2: Events

  1. DOM Events & Event Listeners
  2. Event Bubbling & Capturing
  3. Event Delegation
  4. event.target vs event.currentTarget
  5. Preventing Default Behaviour
  6. Custom Events

📝 Part 3: Forms, Data & Lifecycle

  1. Form Handling & Validation
  2. Working with data-* Attributes