Document Object Model

The Document Object Model (DOM) is an application programming interface (API) for valid HTML and well-formed XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated. In the DOM specification, the term "document" is used in the broad sense - increasingly, XML is being used as a way of representing many different kinds of information that may be stored in diverse systems, and much of this would traditionally be seen as data rather than as documents. Nevertheless, XML presents this data as documents, and the DOM may be used to manage this data.

Basically, the Document Object Model (DOM) is the model that describes how all elements in an HTML page, like input fields, images, paragraphs etc., are related to the topmost structure: the DOCUMENT itself.

With the Document Object Model, programmers can build documents, navigate their structure, and add, modify, or delete elements and their attributes (content). Anything found in an HTML or XML document can be accessed, changed, deleted, or added using the Document Object Model, with a few exceptions...

By calling the element by its proper DOM name, we can influence it.


 * http://en.wikipedia.org/wiki/Document_Object_Model
 * http://www.w3.org/TR/DOM-Level-3-Core/introduction.html

Example of document.write:
 * http://www.w3schools.com/js/js_whereto.asp
 * http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery