Hour 11. Navigating the DOM

What You’ll Learn in This Hour

• The concept of nodes

• The different types of node

• Using nodeName, nodeType, and nodeValue

• Using the childNodes collection

• Selecting elements with getElementsByTagName()

• How to use Mozilla’s DOM Inspector

You’ve already learned about the W3C DOM and, in the worked examples of previous hours, you used various DOM objects, properties, and methods.

In this hour you begin exploring how JavaScript can directly interact with the DOM. In particular, you learn some new ways to navigate around the DOM, selecting particular DOM objects that represent parts of the page’s HTML contents.

DOM Nodes

In Part I, “First Steps with JavaScript,” you were introduced to the W3C Document Object ...

Get Sams Teach Yourself JavaScript™ in 24 Hours, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.