1

Possible Duplicate:
What is DOM element?

I'm learning HTML and CSS and are now trying to learn JavaScript. Came across something called DOM.

I don't really get when the DOM are created. And I don't really get where it is located? Is it some sort of file? Where can I find it and how can I view it. Is it created automatically when save my index.html

Community
  • 1
  • 1
VoteForPedro
  • 33
  • 1
  • 5

1 Answers1

2

The Document Object Model (DOM) is just the way your browser internally represents the HTML. It is a perfect tree-structure, which makes it very easy to visualize/manipulate.

The easiest way to see it is probably in the developer tools of your browser. For example in Chrome, press ctrl-shift-I (or F12) to open the developer tools. Then you can find the DOM in the Elements tab.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • 1
    OK. But I still don't really understand the difference between a basic structure of a HTML-document and the structure of the DOM. It seems to me to be no big difference visually. Therefore I don't really see the purpose or the point of the DOM. But thanks for answering :) – VoteForPedro Dec 22 '12 at 02:04
  • 1
    They are not two separated things, not in that sense anyway. DOM is the platform/interface by which web pages are interpreted. HTML is the language you use to give instructions to the browser. Web browsers use the DOM to read your HTML code and compile webpages. – nienn Dec 22 '12 at 10:19