Chapter 8: DOM element Properties

In the previous chapter, we learned different methods to select elements in DOM. In this chapter, we are going to learn about different properties that we can use with the DOM elements.

Before we start, let’s create a new HTML file and name it DOMProperties.html. Add the following code to the file.

<html>
    <head>
        <title>DOM Properties</title>
    </head>
    <body>
        <div id = "first">The first div tag</div>
        <div id = "second">The second div tag</div>
        <div id = "third">The third div tag</div>
        <script type="text/javascript" src="chap8.js"></script>
    </body>
</html>

Next, create a new file and name it chap8.js.