I’ll start answering this question with HTM

Laxman Kumar

Updated on:

HTML, as we know is used to create very simple, static web pages. This isn’t very pleasing to the normal user. So? What’s the solution? Solutions are languages like CSS and JavaScript. Now these other languages need to have some medium to interact with the traditional HTML markup. This is where DOM or Document Object Model comes in.
So how will these other languages know what to modify in HTML? How will their functions work if they cannot recognize the HTML elements. So, our browsers follow a cross-language standard to render the HTML code. This standard is called the DOM.


Following this DOM browsers render the code as a tree. For example, the opening tag is the root, and all tags within it are its nodes and so on. Note the elements in the tree now are treated as objects not traditional HTML tags.
These objects are now identified using their “id” which can be thought to be a “reference” (similar to pointers).
So, now JavaScript etc can easily know what elements are there in the code, what are their properties and their location. They can now be manipulated as objects and easily modified. This modification is called “working with the DOM”.

Sharing Is Caring: