Document Object Model (DOM)
The Document Object Model (DOM) connects web pages to scripts or programming languages. Usually that means JavaScript, although modelling HTML, SVG, or XML documents as objects is not part of the JavaScript language, as such.
The DOM 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 also 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
(en-US)CDATASection
(en-US)CharacterData
(en-US)ChildNode
(en-US)Comment
CustomEvent
(en-US)Document
(en-US)DocumentFragment
(en-US)DocumentType
(en-US)DOMError
(en-US)DOMException
(en-US)DOMImplementation
(en-US)DOMString
(en-US)DOMTimeStamp
(en-US)DOMStringList
(en-US)DOMTokenList
(en-US)Element
(en-US)Event
EventTarget
HTMLCollection
(en-US)MutationObserver
MutationRecord
(en-US)NamedNodeMap
(en-US)Node
NodeFilter
(en-US)NodeIterator
(en-US)NodeList
(en-US)NonDocumentTypeChildNode
(en-US)ParentNode
(en-US)ProcessingInstruction
(en-US)Selection
(en-US)Range
(en-US)Text
(en-US)TextDecoder
(en-US)TextEncoder
(en-US)TimeRanges
(en-US)TreeWalker
(en-US)URL
(en-US)Window
Worker
(en-US)XMLDocument
(en-US)
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 specifications have been removed. It is uncertain whether some may be reintroduced in the future or not, but for the time being they should be considered obsolete and should be avoided:
DocumentTouch
(en-US)DOMConfiguration
DOMErrorHandler
DOMImplementationList
DOMImplementationRegistry
DOMImplementationSource
DOMLocator
(en-US)DOMObject
(en-US)DOMSettableTokenList
DOMUserData
(en-US)ElementTraversal
(en-US)Entity
EntityReference
NameList
Notation
(en-US)TypeInfo
(en-US)UserDataHandler
(en-US)
HTML interfaces
A document containing HTML is described using the Document
(en-US) interface, which is extended by the HTML specification to include various HTML-specific features.
An HTML document 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
(en-US). Eventually, Selection
(en-US) is done on the document.
HTML element interfaces
HTMLAnchorElement
(en-US)HTMLAppletElement
HTMLAreaElement
(en-US)HTMLAudioElement
(en-US)HTMLBaseElement
(en-US)HTMLBodyElement
(en-US)HTMLBRElement
(en-US)HTMLButtonElement
(en-US)HTMLCanvasElement
(en-US)HTMLDataElement
(en-US)HTMLDataListElement
(en-US)HTMLDialogElement
(en-US)HTMLDirectoryElement
HTMLDivElement
(en-US)HTMLDListElement
(en-US)HTMLElement
HTMLEmbedElement
(en-US)HTMLFieldSetElement
(en-US)HTMLFontElement
(en-US)HTMLFormElement
(en-US)HTMLFrameElement
HTMLFrameSetElement
(en-US)HTMLHeadElement
(en-US)HTMLHeadingElement
(en-US)HTMLHtmlElement
(en-US)HTMLHRElement
(en-US)HTMLIFrameElement
(en-US)HTMLImageElement
HTMLInputElement
(en-US)HTMLKeygenElement
(en-US)HTMLLabelElement
(en-US)HTMLLegendElement
(en-US)HTMLLIElement
(en-US)HTMLLinkElement
(en-US)HTMLMapElement
(en-US)HTMLMarqueeElement
(en-US)HTMLMediaElement
(en-US)HTMLMenuElement
(en-US)HTMLMenuItemElement
(en-US)HTMLMetaElement
(en-US)HTMLMeterElement
(en-US)HTMLModElement
(en-US)HTMLObjectElement
(en-US)HTMLOListElement
(en-US)HTMLOptGroupElement
(en-US)HTMLOptionElement
(en-US)HTMLOutputElement
(en-US)HTMLParagraphElement
(en-US)HTMLParamElement
(en-US)HTMLPreElement
(en-US)HTMLProgressElement
(en-US)HTMLQuoteElement
(en-US)HTMLScriptElement
(en-US)HTMLSelectElement
(en-US)HTMLSourceElement
(en-US)HTMLSpanElement
(en-US)HTMLStyleElement
(en-US)HTMLTableElement
(en-US)HTMLTableCaptionElement
(en-US)HTMLTableCellElement
(en-US)HTMLTableDataCellElement
(en-US)HTMLTableHeaderCellElement
(en-US)HTMLTableColElement
(en-US)HTMLTableRowElement
(en-US)HTMLTableSectionElement
(en-US)HTMLTextAreaElement
(en-US)HTMLTimeElement
(en-US)HTMLTitleElement
(en-US)HTMLTrackElement
(en-US)HTMLUListElement
(en-US)HTMLUnknownElement
(en-US)HTMLVideoElement
(en-US)
Other interfaces
CanvasRenderingContext2D
(en-US)WebGLRenderingContext
(en-US)CanvasGradient
(en-US)CanvasPattern
(en-US)TextMetrics
(en-US)ImageData
(en-US)CanvasPixelArray
(en-US)NotifyAudioAvailableEvent
(en-US)HTMLAllCollection
HTMLFormControlsCollection
(en-US)HTMLOptionsCollection
(en-US)HTMLPropertiesCollection
DOMStringMap
(en-US)RadioNodeList
(en-US)MediaError
(en-US)
Obsolete HTML interfaces
SVG interfaces
SVG element interfaces
SVGAElement
(en-US)SVGAltGlyphElement
(en-US)SVGAltGlyphDefElement
(en-US)SVGAltGlyphItemElement
(en-US)SVGAnimationElement
(en-US)SVGAnimateElement
(en-US)SVGAnimateColorElement
(en-US)SVGAnimateMotionElement
(en-US)SVGAnimateTransformElement
(en-US)SVGCircleElement
(en-US)SVGClipPathElement
(en-US)SVGColorProfileElement
(en-US)SVGComponentTransferFunctionElement
(en-US)SVGCursorElement
(en-US)SVGDefsElement
(en-US)SVGDescElement
(en-US)SVGElement
(en-US)SVGEllipseElement
(en-US)SVGFEBlendElement
(en-US)SVGFEColorMatrixElement
(en-US)SVGFEComponentTransferElement
(en-US)SVGFECompositeElement
(en-US)SVGFEConvolveMatrixElement
(en-US)SVGFEDiffuseLightingElement
(en-US)SVGFEDisplacementMapElement
(en-US)SVGFEDistantLightElement
(en-US)SVGFEDropShadowElement
(en-US)SVGFEFloodElement
(en-US)SVGFEFuncAElement
(en-US)SVGFEFuncBElement
(en-US)SVGFEFuncGElement
(en-US)SVGFEFuncRElement
(en-US)SVGFEGaussianBlurElement
(en-US)SVGFEImageElement
(en-US)SVGFEMergeElement
(en-US)SVGFEMergeNodeElement
(en-US)SVGFEMorphologyElement
(en-US)SVGFEOffsetElement
(en-US)SVGFEPointLightElement
(en-US)SVGFESpecularLightingElement
(en-US)SVGFESpotLightElement
(en-US)SVGFETileElement
(en-US)SVGFETurbulenceElement
(en-US)SVGFilterElement
(en-US)SVGFilterPrimitiveStandardAttributes
(en-US)SVGFontElement
(en-US)SVGFontFaceElement
(en-US)SVGFontFaceFormatElement
(en-US)SVGFontFaceNameElement
(en-US)SVGFontFaceSrcElement
(en-US)SVGFontFaceUriElement
(en-US)SVGForeignObjectElement
(en-US)SVGGElement
(en-US)SVGGeometryElement
(en-US)SVGGlyphElement
(en-US)SVGGlyphRefElement
(en-US)SVGGradientElement
(en-US)SVGGraphicsElement
(en-US)SVGHatchElement
SVGHatchpathElement
SVGHKernElement
(en-US)SVGImageElement
(en-US)SVGLinearGradientElement
(en-US)SVGLineElement
(en-US)SVGMarkerElement
SVGMaskElement
(en-US)SVGMeshElement
SVGMeshGradientElement
SVGMeshpatchElement
SVGMeshrowElement
SVGMetadataElement
(en-US)SVGMissingGlyphElement
(en-US)SVGMPathElement
(en-US)SVGPathElement
(en-US)SVGPatternElement
(en-US)SVGPolylineElement
(en-US)SVGPolygonElement
(en-US)SVGRadialGradientElement
(en-US)SVGRectElement
(en-US)SVGScriptElement
(en-US)SVGSetElement
(en-US)SVGSolidcolorElement
(en-US)SVGStopElement
(en-US)SVGStyleElement
(en-US)SVGSVGElement
(en-US)SVGSwitchElement
(en-US)SVGSymbolElement
(en-US)SVGTextContentElement
(en-US)SVGTextElement
(en-US)SVGTextPathElement
(en-US)SVGTextPositioningElement
(en-US)SVGTitleElement
(en-US)SVGTRefElement
(en-US)SVGTSpanElement
(en-US)SVGUseElement
(en-US)SVGUnknownElement
SVGViewElement
(en-US)SVGVKernElement
(en-US)
SVG data type interfaces
Here are the DOM APIs 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
(en-US), SVGNumberList
(en-US), SVGPathSegList
, and SVGPointList
.
Static type
SVGAngle
(en-US)SVGColor
SVGICCColor
SVGElementInstance
SVGElementInstanceList
SVGLength
(en-US)SVGLengthList
(en-US)SVGMatrix
(en-US)SVGNameList
SVGNumber
(en-US)SVGNumberList
(en-US)SVGPaint
SVGPathSeg
SVGPathSegClosePath
SVGPathSegMovetoAbs
SVGPathSegMovetoRel
SVGPathSegLinetoAbs
SVGPathSegLinetoRel
SVGPathSegCurvetoCubicAbs
SVGPathSegCurvetoCubicRel
SVGPathSegCurvetoQuadraticAbs
SVGPathSegCurvetoQuadraticRel
SVGPathSegArcAbs
SVGPathSegArcRel
SVGPathSegLinetoHorizontalAbs
SVGPathSegLinetoHorizontalRel
SVGPathSegLinetoVerticalAbs
SVGPathSegLinetoVerticalRel
SVGPathSegCurvetoCubicSmoothAbs
SVGPathSegCurvetoCubicSmoothRel
SVGPathSegCurvetoQuadraticSmoothAbs
SVGPathSegCurvetoQuadraticSmoothRel
SVGPathSegList
SVGPoint
(en-US)SVGPointList
SVGPreserveAspectRatio
(en-US)SVGRect
(en-US)SVGStringList
(en-US)SVGTransform
(en-US)SVGTransformList
(en-US)
Animated type
SVGAnimatedAngle
(en-US)SVGAnimatedBoolean
(en-US)SVGAnimatedEnumeration
(en-US)SVGAnimatedInteger
(en-US)SVGAnimatedLength
(en-US)SVGAnimatedLengthList
(en-US)SVGAnimatedNumber
(en-US)SVGAnimatedNumberList
(en-US)SVGAnimatedPathData
SVGAnimatedPoints
(en-US)SVGAnimatedPreserveAspectRatio
(en-US)SVGAnimatedRect
(en-US)SVGAnimatedString
(en-US)SVGAnimatedTransformList
(en-US)
SMIL related interfaces
Other SVG interfaces
GetSVGDocument
ShadowAnimation
SVGColorProfileRule
SVGCSSRule
SVGDocument
SVGException
SVGExternalResourcesRequired
(en-US)SVGFitToViewBox
SVGLangSpace
SVGLocatable
SVGRenderingIntent
(en-US)SVGStylable
(en-US)SVGTests
(en-US)SVGTransformable
(en-US)SVGUnitTypes
(en-US)SVGUseElementShadowRoot
SVGURIReference
(en-US)SVGViewSpec
SVGZoomAndPan
(en-US)SVGZoomEvent
Specifications
Specification | Status | Comment |
---|---|---|
DOM | Living Standard | |
DOM4 | Obsolete | |
Document Object Model (DOM) Level 3 Core Specification | Obsolete | |
Document Object Model (DOM) Level 2 Core Specification | Obsolete | g |
Document Object Model (DOM) Level 1 Specification | Obsolete | Initial definition |