Document Object Model (DOM)
The Document Object Model (DOM) connects web pages to scripts or programming languages by representing the structure of a document—such as the HTML representing a web page—in memory. Usually it refers to JavaScript, even though modeling HTML, SVG, or XML documents as objects are not part of the core JavaScript language.
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.
To learn more about what the DOM is and how it represents documents, see our article Introduction to the DOM.
DOM interfaces
Attr
CDATASection
CharacterData
Comment
CustomEvent
Document
DocumentFragment
DocumentType
-
DOMError
DOMException
DOMImplementation
DOMString
DOMTimeStamp
DOMStringList
DOMTokenList
Element
Event
EventTarget
HTMLCollection
MutationObserver
MutationRecord
NamedNodeMap
Node
NodeFilter
NodeIterator
NodeList
ProcessingInstruction
-
Selection
Range
Text
-
TextDecoder
-
TextEncoder
TimeRanges
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 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:
DOMConfiguration
DOMErrorHandler
DOMImplementationList
DOMImplementationRegistry
DOMImplementationSource
DOMLocator
DOMObject
DOMSettableTokenList
DOMUserData
ElementTraversal
Entity
EntityReference
NameList
Notation
TypeInfo
UserDataHandler
HTML DOM
A document containing HTML is described using the Document
interface, which is extended by the HTML specification to include various HTML-specific features. In particular, the Element
interface is enhanced to become HTMLElement
and various subclasses, each representing one of (or a family of closely related) elements.
The HTML DOM API provides access to various browser features such as tabs and windows, CSS styles and stylesheets, browser history, and so forth. These interfaces are discussed further in the HTML DOM API documentation.
SVG interfaces
SVG element interfaces
SVGAElement
-
SVGAltGlyphElement
-
SVGAltGlyphDefElement
-
SVGAltGlyphItemElement
SVGAnimationElement
SVGAnimateElement
-
SVGAnimateColorElement
SVGAnimateMotionElement
SVGAnimateTransformElement
SVGCircleElement
SVGClipPathElement
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
SVGStopElement
SVGStyleElement
SVGSVGElement
SVGSwitchElement
SVGSymbolElement
SVGTextContentElement
SVGTextElement
SVGTextPathElement
SVGTextPositioningElement
SVGTitleElement
-
SVGTRefElement
SVGTSpanElement
SVGUseElement
SVGViewElement
-
SVGVKernElement
SVG data type interfaces
Here are the DOM APIs for data types used in the definitions of SVG properties and attributes.
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
SVGAnimatedAngle
SVGAnimatedBoolean
SVGAnimatedEnumeration
SVGAnimatedInteger
SVGAnimatedLength
SVGAnimatedLengthList
SVGAnimatedNumber
SVGAnimatedNumberList
-
SVGAnimatedPathData
SVGAnimatedPoints
SVGAnimatedPreserveAspectRatio
SVGAnimatedRect
SVGAnimatedString
SVGAnimatedTransformList
SMIL-related interfaces
Other SVG interfaces
GetSVGDocument
ShadowAnimation
-
SVGColorProfileRule
-
SVGCSSRule
SVGDocument
-
SVGException
SVGFitToViewBox
-
SVGLocatable
-
SVGRenderingIntent
SVGUnitTypes
SVGUseElementShadowRoot
-
SVGViewSpec
-
SVGZoomEvent
Specifications
Specification |
---|
DOM Living Standard |
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model