--- title: Document Object Model (DOM) slug: Web/API/Document_Object_Model tags: - API - DOM - DOM Reference - Intermediate - Reference translation_of: Web/API/Document_Object_Model ---
{{DefaultAPISidebar("DOM")}}

Il Document Object Model (DOM) rappresenta una pagina web come un documento con un albero logico di oggetti.

Ogni ramo dell'albero termina in un nodo, e ogni nodo contiene oggetti. Il modello DOM collega le pagine web agli script o ai linguaggi di programmazione. Usualmente significa usare JavaScript, anche se modellare documenti HTML, SVG o XML come oggetti non è parte del linguaggio JavaScript.

I metodi del DOM permettono un accesso programmatico all'albero; tramite i metodi e le proprietà del DOM è possibile modificare la struttura del documento stesso, lo stile e/o il contenuto.

I nodi possono avere degli eventi aggangiati ad essi e quando un evento viene scatenato, l'handler dell'evento viene eseguito.

E' disponibile una introduzione al DOM.

Interfacce DOM

Interfacce DOM obsolete {{obsolete_inline}}

The Document Object Model has been highly simplified. To achieve this, the following interfaces present in the different DOM level 3 or earlier specification have been removed. It is still not very clear whether some may be reintroduced or not, but for the time being 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 various features of browsers like the tab or the 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, {{domxref("Selection")}} is done on the document.

HTML element interfaces

Other interfaces

Obsolete HTML interfaces {{obsolete_inline}}

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 ; 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

Other SVG interfaces

See also