Wednesday, March 11, 2015

Introduction To DOM (Document Object Model)

DOM concept has a great significance when it comes to client side coding. It is must for programmer to have basic understanding of this before working with client side technologies like JavaScript, Jquery, Angular JS etc.

In this blog, I am going to present it in simpler terms.

First and foremost thing to understand is that DOM is neither HTML nor it is view source. It is the browser which parse and transforms it in DOM. If you view the HTML page in developer tool panel, you get the HTML presented in node like hierarchical structure that is actually the DOM.


DOM provides the platform or programming interface to interact with HTML page  and manipulate it. 

When we say DOM manipulation, It means access, delete or modify the HTML elements, their attributes and styles, their content and structure. DOM is based on object oriented approach and each HTML element represents object. The DOM object has properties and methods attached to it. for e.g getElementById() is most used method while accessing it through JavaScript. JavaScript is not DOM but the way to interact with HTML via DOM properties and methods.













No comments:

Post a Comment