### What is the Document Object Model?

The current DOM standard is at https://dom.spec.whatwg.org/. It is a complete specification for the DOM and supersedes all previous DOM specifications. 

The legacy DOM2 specification http://www.w3.org/TR/DOM-Level-2-Core/introduction.html described the DOM in the following terms:

> 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**. [...] Nevertheless, **XML presents this data as documents**, and the DOM may be used to manage this data.

In other words, the DOM is not a string, but HTML/XML may represent the DOM as a string.

In the distant past, the DOM was limited in the kinds of elements that could be accessed. Form, link and image elements could be referenced with a hierarchical name that began with the root document object. A hierarchical name could make use of either the names or the sequential index of the traversed elements. For example, a form input element could be accessed as either document.formName.inputName or document.forms[0].elements[0].

JavaScript vs. the DOM
==
JavaScript is a language that the browser reads and does stuff with. But the DOM is where that stuff happens. 

When is the DOM different than the HTML?
===
Here's one possibility: there are mistakes in your HTML and the browser has fixed them for you. Let's say you have a `<table>` element in your HTML and leave out the required `<tbody>` element. The browser will just insert that `<tbody>` for you. It will be there in the DOM, so you'll be able to find it with JavaScript and style it with CSS, even though it's not in your HTML.


-----

### DOM Living standard

- https://dom.spec.whatwg.org/

### Obsolete DOM specs

- [DOM Level 1][2]
- [DOM Level 2 Core][3]
- [DOM Level 2 Views][4] (Obsolete)
- [DOM Level 2 Events][5]
- [DOM Level 2 Style][6]
- [DOM Level 2 Traversal and Range][7]
- [DOM Level 2 HTML][8]
- [DOM Level 3 Core][9]
- [DOM Level 3 Load and Save][10]
- [DOM Level 3 Validation][11]
- [DOM Level 3 Events][12]
- [DOM Level 3 XPath][13]
- [DOM Level 4 Core][14]

-----

### Useful references

- [Quirks mode compatibility tables][15]
- [MSXML DOM Reference][16]
- [Gecko DOM Reference][17]
- [The DOM in .NET][18]
- [Document Object Model Wikipedia Article][19]
- [DOM documentation on StackOverflow][20]


  [1]: http://www.w3.org/TR/DOM-Level-2-Core/introduction.html
  [2]: http://www.w3.org/TR/REC-DOM-Level-1/
  [3]: http://www.w3.org/TR/DOM-Level-2-Core/
  [4]: http://www.w3.org/TR/DOM-Level-2-Views/
  [5]: http://www.w3.org/TR/DOM-Level-2-Events/
  [6]: http://www.w3.org/TR/DOM-Level-2-Style/
  [7]: http://www.w3.org/TR/DOM-Level-2-Traversal-Range/
  [8]: http://www.w3.org/TR/DOM-Level-2-HTML/
  [9]: http://www.w3.org/TR/DOM-Level-3-Core/
  [10]: http://www.w3.org/TR/DOM-Level-3-LS/
  [11]: http://www.w3.org/TR/DOM-Level-3-Val/
  [12]: http://www.w3.org/TR/DOM-Level-3-Events/
  [13]: http://www.w3.org/TR/DOM-Level-3-XPath/
  [14]: http://www.w3.org/TR/domcore/
  [15]: http://www.quirksmode.org/compatibility.html
  [16]: http://msdn.microsoft.com/en-us/library/ms766487.aspx
  [17]: https://developer.mozilla.org/en/gecko_dom_reference
  [18]: http://msdn.microsoft.com/en-us/library/hf9hbf87.aspx
  [19]: http://en.wikipedia.org/wiki/Document_Object_Model
  [20]: http://stackoverflow.com/documentation/dom/topics