--- title: DOM slug: DOM tags: - DOM translation_of: Web/API/Document_Object_Model translation_of_original: DOM ---

The Document Object Model (DOM) is a programming interface for HTML, XML and SVG documents. It provides a structured representation of the document (a tree) and it defines a way that the structure can be accessed from programs so that they can change the document structure, style and content. The DOM provides a representation of the document as a structured group of nodes and objects that have properties and methods. Nodes can also have event handlers attached to them, and once that event is triggered the event handlers get executed. Essentially, it connects web pages to scripts or programming languages.

Though often accessed using JavaScript, the DOM itself is not a part of the JavaScript language, and it can be accessed by other languages, though this is much less common.

An introduction to the DOM is available.

DOM interfaces

Obsolete DOM interfaces

The Document Object Model is being highly simplified. In order to achieve this the following interfaces present in the different DOM level 3 or earlier specification have been removed. It is still unclear if some may be reintroduced, but for the moment they have to be considered as obsolete and should be avoided:

HTML interfaces

A document containing HTML is described using the {{domxref("HTMLDocument")}} interface. Note that the HTML specification also extends the {{domxref("Document")}} interface.

An HTMLDocument object also gives access to browser features: the tab, or window, in which a page is drawn using the {{domxref("Window")}} interface, the {{domxref("window.style", "Style")}} associated to it (usually CSS), the history of the browser relative to the context, {{domxref("window.history", "History")}} , eventually a {{domxref("Selection")}} done on the document.

HTML element interfaces

Other interfaces

Obsolete HTML interfaces

SVG interfaces

SVG element interfaces

SVG data type interfaces

Here are the DOM API for data types used in the definitions of SVG properties and attributes.

Note: Starting in {{Gecko("5.0")}},the following SVG-related DOM interfaces representing lists of objects are now indexable and can be accessed like arrays; in addition, they have a length property indicating the number of items in the lists: {{domxref("SVGLengthList")}}, {{domxref("SVGNumberList")}}, {{domxref("SVGPathSegList")}}, and {{domxref("SVGPointList")}}.

Static type

Animated type

SVG Path segment interfaces

Other SVG interfaces

See also