COMP 20: Web Programming

Document Object Model (DOM)

Consider the Example

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />
</head>
<body>
<h1>This is a heading</h1>
<p>A paragraph with a <a href="http://www.google.com/">link</a>.</p>
<ul>
<li>a list item</li>
<li>another list item</li>
<li>a third list item</li>
</ul>
</body>
</html>

Nodes

Example