The Document Object Model (DOM) connects web pages to scripts or programming languages. Usually that means JavaScript, but modelling HTML, SVG, or XML documents as objects is not part of the JavaScript language. The DOM model represents a document with a logical tree. Each branch of the tree ends in a node, and each node contains objects. DOM methods allow programmatic access to the tree; with them you can change the document's structure, style or content. Nodes can have event handlers attached to them. Once an event is triggered, the event handlers get executed.
An introduction to the DOM is available.
DOM interfaces
Attr
CharacterData
ChildNode
Comment
CustomEvent
Document
DocumentFragment
DocumentType
DOMError
DOMException
DOMImplementation
DOMString
DOMTimeStamp
DOMSettableTokenList
DOMStringList
DOMTokenList
Element
Event
EventTarget
HTMLCollection
MutationObserver
MutationRecord
Node
NodeFilter
NodeIterator
NodeList
ParentNode
ProcessingInstruction
Range
Text
TreeWalker
URL
Window
Worker
XMLDocument
Obsolete DOM interfaces
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 HTMLDocument
interface. Note that the HTML specification also extends the 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 Window
interface, the Style
associated to it (usually CSS), the history of the browser relative to the context, History
. Eventually, Selection
is done on the document.
HTML element interfaces
HTMLAnchorElement
HTMLAppletElement
HTMLAreaElement
HTMLAudioElement
HTMLBaseElement
HTMLBodyElement
HTMLBRElement
HTMLButtonElement
HTMLCanvasElement
HTMLDataElement
HTMLDataListElement
HTMLDialogElement
HTMLDirectoryElement
HTMLDivElement
HTMLDListElement
HTMLElement
HTMLEmbedElement
HTMLFieldSetElement
HTMLFontElement
HTMLFormElement
HTMLFrameElement
HTMLFrameSetElement
HTMLHeadElement
HTMLHeadingElement
HTMLHtmlElement
HTMLHRElement
HTMLIFrameElement
HTMLImageElement
HTMLInputElement
HTMLKeygenElement
HTMLLabelElement
HTMLLegendElement
HTMLLIElement
HTMLLinkElement
HTMLMapElement
HTMLMediaElement
HTMLMenuElement
HTMLMetaElement
HTMLMeterElement
HTMLModElement
HTMLObjectElement
HTMLOListElement
HTMLOptGroupElement
HTMLOptionElement
HTMLOutputElement
HTMLParagraphElement
HTMLParamElement
HTMLPreElement
HTMLProgressElement
HTMLQuoteElement
HTMLScriptElement
HTMLSelectElement
HTMLSourceElement
HTMLSpanElement
HTMLStyleElement
HTMLTableElement
HTMLTableCaptionElement
HTMLTableCellElement
HTMLTableDataCellElement
HTMLTableHeaderCellElement
HTMLTableColElement
HTMLTableRowElement
HTMLTableSectionElement
HTMLTextAreaElement
HTMLTimeElement
HTMLTitleElement
HTMLTrackElement
HTMLUListElement
HTMLUnknownElement
HTMLVideoElement
Other interfaces
Obsolete HTML interfaces
SVG interfaces
SVG element interfaces
SVGAElement
SVGAltGlyphElement
SVGAltGlyphDefElement
SVGAltGlyphItemElement
SVGAnimationElement
SVGAnimateElement
SVGAnimateColorElement
SVGAnimateMotionElement
SVGAnimateTransformElement
SVGCircleElement
SVGClipPathElement
SVGColorProfileElement
SVGComponentTransferFunctionElement
SVGCursorElement
SVGDefsElement
SVGDescElement
SVGElement
SVGEllipseElement
SVGFEBlendElement
SVGFEColorMatrixElement
SVGFEComponentTransferElement
SVGFECompositeElement
SVGFEConvolveMatrixElement
SVGFEDiffuseLightingElement
SVGFEDisplacementMapElement
SVGFEDistantLightElement
SVGFEDropShadowElement
SVGFEFloodElement
SVGFEFuncAElement
SVGFEFuncBElement
SVGFEFuncGElement
SVGFEFuncRElement
SVGFEGaussianBlurElement
SVGFEImageElement
SVGFEMergeElement
SVGFEMergeNodeElement
SVGFEMorphologyElement
SVGFEOffsetElement
SVGFEPointLightElement
SVGFESpecularLightingElement
SVGFESpotLightElement
SVGFETileElement
SVGFETurbulenceElement
SVGFilterElement
SVGFilterPrimitiveStandardAttributes
SVGFontElement
SVGFontFaceElement
SVGFontFaceFormatElement
SVGFontFaceNameElement
SVGFontFaceSrcElement
SVGFontFaceUriElement
SVGForeignObjectElement
SVGGElement
SVGGeometryElement
SVGGlyphElement
SVGGlyphRefElement
SVGGradientElement
SVGGraphicsElement
SVGHatchElement
SVGHatchpathElement
SVGHKernElement
SVGImageElement
SVGLinearGradientElement
SVGLineElement
SVGMarkerElement
SVGMaskElement
SVGMeshElement
SVGMeshGradientElement
SVGMeshpatchElement
SVGMeshrowElement
SVGMetadataElement
SVGMissingGlyphElement
SVGMPathElement
SVGPathElement
SVGPatternElement
SVGPolylineElement
SVGPolygonElement
SVGRadialGradientElement
SVGRectElement
SVGScriptElement
SVGSetElement
SVGSolidcolorElement
SVGStopElement
SVGStyleElement
SVGSVGElement
SVGSwitchElement
SVGSymbolElement
SVGTextContentElement
SVGTextElement
SVGTextPathElement
SVGTextPositioningElement
SVGTitleElement
SVGTRefElement
SVGTSpanElement
SVGUseElement
SVGUnknownElement
SVGViewElement
SVGVKernElement
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: SVGLengthList
, SVGNumberList
, SVGPathSegList
, and SVGPointList
.
Static type
SVGAngle
SVGColor
SVGICCColor
SVGElementInstance
SVGElementInstanceList
SVGLength
SVGLengthList
SVGMatrix
SVGNameList
SVGNumber
SVGNumberList
SVGPaint
SVGPathSeg
SVGPathSegClosePath
SVGPathSegMovetoAbs
SVGPathSegMovetoRel
SVGPathSegLinetoAbs
SVGPathSegLinetoRel
SVGPathSegCurvetoCubicAbs
SVGPathSegCurvetoCubicRel
SVGPathSegCurvetoQuadraticAbs
SVGPathSegCurvetoQuadraticRel
SVGPathSegArcAbs
SVGPathSegArcRel
SVGPathSegLinetoHorizontalAbs
SVGPathSegLinetoHorizontalRel
SVGPathSegLinetoVerticalAbs
SVGPathSegLinetoVerticalRel
SVGPathSegCurvetoCubicSmoothAbs
SVGPathSegCurvetoCubicSmoothRel
SVGPathSegCurvetoQuadraticSmoothAbs
SVGPathSegCurvetoQuadraticSmoothRel
SVGPathSegList
SVGPoint
SVGPointList
SVGPreserveAspectRatio
SVGRect
SVGStringList
SVGTransform
SVGTransformList
Animated type
SMIL related interfaces
Other SVG interfaces
GetSVGDocument
ShadowAnimation
SVGColorProfileRule
SVGCSSRule
SVGDocument
SVGException
SVGExternalResourcesRequired
SVGFitToViewBox
SVGLangSpace
SVGLocatable
SVGRenderingIntent
SVGStylable
SVGTests
SVGTransformable
SVGUnitTypes
SVGUseElementShadowRoot
SVGURIReference
SVGViewSpec
SVGZoomAndPan
SVGZoomEvent