DOM Document

The DOM document will be holding all the objects, properties, events and methods to access the HTML document.
In javascript, we use document object to access and manipulate the HTML.


    <title>JavaScript getElementById() Method</title>
    <p id="message">ReadersBuddy</p>
   const para = document.getElementById('message');


<p id="message">ReadersBuddy</p>

In the above example, we have used getElementById method of document to get the para element with id message.

The document object has many other functions to manipulate the HTML elements.
We shall see in our next tutorials.

Most Read