Sample Web Page
Let's see how to use JavaScript to traverse the DOM.
We'll cover the following...
Here’s the example web page used throughout this chapter.
Explanation
Let’s see the above HTML code in detail.
- Line 1: Declares
<html>
tag and with this tag, HTML document starts. - Lines 2-3: Declare opening and closing of
<head>
tag. The Head section of our