Java Reference
In-Depth Information
An Example Web Page
To illustrate the DOM concepts covered in this chapter, we'll use a basic web page that
contains a heading and three paragraph elements. Save the following code in a file called
dom.htm:
dom.htm
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Triathlon DOM</title>
</head>
<body>
<header>
<h1 id="title">Triathlon</h1>
</header>
<section id="sports">
<p class="swim">Swim</p>
<p id="bike">Bike</p>
<p>Run</p>
</section>
</body>
</html>
Figure 6.2 shows what this web page would look like as a node tree diagram.
Search WWH ::




Custom Search