Main Page

The Document Object Model (DOM)

Browser
ECMAScript Compliance
Internet Explorer 5.0
Edition 1
Internet Explorer 5.5+
Edition 3
Opera 6.0–7.1
Edition 2
Opera 7.2+
Edition 3
Safari 1.0+/Konqueror ~2.0+
Edition 3
The Document Object Model (DOM)
The
Document Object Model
(DOM) is an application programming interface (API) for HTML as well as
XML. The DOM maps out an entire page as a document composed of a hierarchy of nodes. Each part of
an HTML or XML page is a derivative of a node. Consider the following HTML page:
<html>
<head>
<title>Sample Page</title>
</head>
<body>
<p>Hello World!</p>
</body>
</html>
This code can be diagrammed into a hierarchy of nodes using the DOM (see Figure 1-3).
Figure 1-3
Sample Page
Hello World!
title
head
html
p
body
6
Chapter 1
04_579088 ch01.qxd 3/28/05 11:34 AM Page 6


JavaScript EditorFree JavaScript Editor     Ajax Editor


©

R7