THE DOCUMENT TREE

One way to create dynamic text effects is to use one of the methods of the DOM (Document Object Model). When you use the DOM, you're manipulating a document tree .

A document can be represented as a tree structure. For example, the following HTML document:

<html>
<head>
<title>My Page</title>
</head>
<body>
<p>My Paragraph</p>
</body>
</html>

can be represented as a tree, as shown in Figure 6-3. The <head> and <body> elements are children of the <html> element, the <title> element is a child of the <head> element, and the <p> element is a child of the <body> element.

Figure 6-3: HTML document tree.
Figure 6-3: HTML document tree.