06: The DOM

The Document Object Model (DOM) is how JavaScript sees and manipulates HTML. It could also be the way the browser stores it internally, but you can't be sure the code is truly written that way. For your purposes it's important to know that HTML is "stored" as a data structure that JavaScript can manipulate. This data structure gets very complex, but I'll cover the most basic important part of it now.

Warmup

This is the code from the Cooldown section of Exercise 5, but I've removed lines that are related to favicons and other platform specific settings for things like Windows and iPads:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Learn JavaScript the Hard Way Template</title>

Learn JavaScript Today

Register today for the Beginner Basics course and get the new releases by just paying the difference. There's also special discounts for existing customers when new courses are released.


Still Not Sure? Check out more curriculum!