Skip to main content

What is DOM for HTML

We all knows that HTML runs on web browser or in client side.But you all may arise a question in your head that how it works on web browser. Well that what I am gonna tailing about right now.Take a Seat .


     When a HTML program runs in web browser,it creates as a tree structure what is together called DOM. DOM is stands for Document Object Model.Where,


                DOCUMENT : a HTML page
                OBJECT : Object indicates all elements and attributes of                                    a HTML page
                MODEL : it indicates tree structure

So , when an HTML page runs on browser it creates a DOM structure.

  But why we should study DOM at least the basic one -- Well DOM helps us a lot. Basically DOM is a W3 Standard to understand HTML Page structure so we can create red update delete an DOM element through Javascript and Jquery methods. If we understand the DOM structure of an HTML page, we can easily control its elements,attributes and all nodes.

I am showing below a simple DOM Structure :




           Wow .... It looks great and easy to understand .

Here DOCUMENT indicates the entire page. We can say a page as a Document. We also may start this structure from HTML element . Here HTML is a root element, and it has two child element is HEAD & BODY (they are siblings) . Again hey both have three child elements separately .So in this case the child elements parent is HEAD , BODY .Again this child elements can have child's .
  
 So the structure is made in this way , totally different story .
  
But one thing again confusing you what I have wrote before this image is Node .This I am explaining too don't worry .
 According to the W3 Standard of HTML DOM, everything in an HTML page is a Node.
                      
                 Entire document is a Document Node .
                 Each element we can say as a Element Node .
                 Every text in a HTML page will be Text Node .
                 All attributes of page are Attribute Node .
                Comments are also Comment Node .

Wow , now we know about HTML DOM .
You can also check my Youtube Channel , link is given below :
       https://www.youtube.com/channel/UCC_SnAOTQP7uckcZR_3QMcQ?view_as=subscriber

 Keep learning ... :)

Comments