Document Object Model: Most folks just call me the DOM. It's an awful lot of trouble to go around saying "Document Object Model."
HeadRush: Oh, that is easier. So, let me get this straight. You're what a web browser sees when it looks at an HTML page?
HeadRush: Oh, that makes sense. Because hardly anyone puts their CSS into their HTML files anymore... the CSS is usually in a separate file.
HeadRush: OK, I get it. So do you make it easier to change what's on a web page, too?
DOM: You got it. You can add a new text node to an element to make text appear, or remove a <div> element from its parent to make an entire section of a page vanish.
DOM: Exactly. I exist in memory all on the web browser, so the browser doesn't need to talk to a server or even be connected to the network to use me.
HeadRush: Wow, that's pretty sweet. I'm looking forward to getting to know you better...
Here's the DOM tree for the HTML you looked at back on page 220. html head title "Binary Tree Selection" body p "Below are two binary tree options:" div "Our " em " trees are great for folks that are far away." "depth-first" div "Our " em " trees are a favorite for nearby neighbors." "breadth-first" p "You can view other products in the " a "." "Main Menu"
You've already seen several ways to use the document object in your code... here are a few reminders from earlier in this chapter.