SHARE

What is DOM

The Document Object Model (DOM) is an application programming interface (API) for valid HTML and well-formed XML documents. DOM or document object model in not a programming language . It is style to defines the logical structure of documents . With this logical stucture user can easily access and manipulate content of the webpage .

In the DOM , document is create like a tree structure with root and branches . In the DOM tree structure root is on top side . Just like following image.

DOM Stucture
DOM Structure

DOM Structure

In the DOM specification, the term “document” is used for complete page. For example a html web page start from code <html> and end at tag </html> . All of content and tag are place in a webpage is called document .

dom1
dom1

Top of tag is called root of document in DOM . As you know , html webpage start with tag <html> . So this tag is called root of Document Object Model . This is also known as Node or parent Node .

In the upper image html tag structure is as follows.

<html>
<head>
<title>This is the title</title>
</head>
<body>
<h1> This is the h1 title </h1>
<p> This is paragraph text </p>
</body>
</html>

In DOM , this html code is divided in well structured format .

First tag is html is parent node or Root of the document . After that head tag and body tag is a directly connected to Html tag so these are known as child of html tag .

Under the head tag titleĀ tag is also known as child element and of head . Text that is written in the title, “This is the title ” is also a Node or a child of title tag . This is also Known as Text Node .

Using DOM or Document Object Model , User can easily access and manipulate a specific area of document .

SHARE
Previous articleYouTube- Add Custom Thumbnail In Youtube
Next articlePHP Lessons- Create An Array In PHP Programming
Manu Mahajan Born 26 Dec 1980 ,Is a founder of Tectrick and MM Toy World. www.tectrick.org is a free digital helping guide on many usable topics to the readers in various method such as Youtube videos , Articles and social media conversation MM Toy World is manufacturer , wholesaler and online retailer of soft toys, personalized gifts ,toys corporate gifts .