Pages

Sunday, July 27, 2014

What is the DOM?

What is meant by the DOM (Document Object Model?).Is it a programming language? Part of a JavaScript? There are thousands of questions in our mind when we hear the word DOM for the first time.
In normal perspective;


So let’s see what the objects in HTML document are. As in the real document we can decompose our original html document into several objects like title tag, header (EX:<h1> )tags, img tag and also we can consider the whole document as one object,



Because sometimes an object may contain other objects too. If we take <ul>(unordered list) for example, it contains several <li> (list) items.
Now definitely you may be wondering what is meant by “Model”, that we have mentioned in “document object model”. Do you know there is a JavaScript term for every object in html page? If any part (or object) in the html document is represented using tree structure, we can explain it as a “model”. Oh do you feel uncomfortable with that term? Please don’t, it’s absolutely a simple thing as mentioned below.






In JavaScript, there are agreed upon terms to access each object mentioned above. On another day we will discuss how to access those elements using JavaScript terms.  

No comments:

Post a Comment