Module 19: Browser Interactions

Lesson 1 of 5 · 15–25 minutes

The DOM

🏠The everyday picture

A family tree: the grandparents at the top, their children below, grandchildren below them. The browser keeps the page in memory as a tree like this, and JavaScript can visit any member.

📘What it really is

🖱️Try it

In the console on your home page, type document.title and press Enter. Then type document.title = "Changed by me" and look at the browser tab. Open the Elements tab and expand the tree to find your <h1>.

✅Quick check

JavaScript changes a heading. Does the HTML file on your computer change?

Show the answer

No. Only the DOM in the browser's memory changes; reload and it's back to the file.

Where do you see the page as it is now, including JavaScript's changes?

Show the answer

The Elements tab in developer tools.

← BackModule 19
ProLearners Assist