Modelo de Objetos del Documento (DOM)
El Modelo de Objetos del Documento (DOM, por sus siglas en Inglés) conecta páginas web a scripts o lenguajes de programación al representar la estructura de un documento, como el HTML que representa una página web, en la memoria. Por lo general, se refiere a JavaScript, aunque el modelado de documentos HTML, SVG o XML como objetos no forma parte del lenguaje principal de JavaScript.
El DOM representa un documento con un árbol lógico. Cada rama del árbol termina en un nodo y cada nodo contiene objetos. Los métodos DOM permiten el acceso programático al árbol. Con ellos, puede cambiar la estructura, el estilo o el contenido del documento.
Los nodos también pueden tener controladores de eventos adjuntos. Una vez que se activa un evento, los controladores de eventos se ejecutan.
Para saber más sobre qué es el DOM y cómo representa los documentos, consulta nuestro artículo Introducción al DOM.
Interfaces DOM
AbortController
(en-US)AbortSignal
(en-US)AbstractRange
(en-US)Attr
CDATASection
(en-US)CharacterData
(en-US)Comment
CustomEvent
Document
DocumentFragment
DocumentType
(en-US)DOMError
ObsoletoDOMException
DOMImplementation
(en-US)DOMParser
DOMPoint
(en-US)DOMPointReadOnly
(en-US)DOMRect
(en-US)DOMTokenList
(en-US)Element
Event
EventTarget
HTMLCollection
MutationObserver
MutationRecord
(en-US)NamedNodeMap
(en-US)Node
NodeFilter
(en-US)NodeIterator
(en-US)NodeList
ProcessingInstruction
(en-US)Range
StaticRange
(en-US)Text
(en-US)TextDecoder
(en-US)TextEncoder
(en-US)TimeRanges
(en-US)TreeWalker
(en-US)XMLDocument
Interfaces DOM obsoletas
El modelo de objetos del documento se ha simplificado mucho. Para lograr esto, se han eliminado las siguientes interfaces presentes en los diferentes DOM nivel 3 o especificaciones anteriores. No está claro si algunos podrán reintroducirse en el futuro o no, pero por el momento deben considerarse obsoletos y deben evitarse:
DOMConfiguration
DOMErrorHandler
DOMImplementationList
DOMImplementationRegistry
DOMImplementationSource
DOMLocator
DOMObject
DOMSettableTokenList
DOMUserData
ElementTraversal
Entity
EntityReference
NameList
Notation
TypeInfo
UserDataHandler
HTML DOM
Un documento que contiene HTML se describe utilizando la interfaz Document
, que se amplía mediante la especificación HTML para incluir varias características específicas de HTML. En particular, la interfaz Element
se mejora para convertirse en HTMLElement
y varias subclases, cada una de las cuales representa uno (o una familia de parientes cercanos) de los elementos.
La API de HTML DOM brinda acceso a varias funciones del navegador, como pestañas y ventanas, estilos y hojas de estilo CSS, historial del navegador, etc. Estas interfaces se analizan con más detalle en la documentación de la API de HTML DOM (en-US).
Interfaces SVG
Interfaces de elementos SVG
SVGAElement
(en-US)SVGAltGlyphElement
(en-US) ObsoletoSVGAltGlyphDefElement
(en-US) ObsoletoSVGAltGlyphItemElement
(en-US) ObsoletoSVGAnimationElement
(en-US)SVGAnimateElement
(en-US)SVGAnimateColorElement
(en-US) ObsoletoSVGAnimateMotionElement
(en-US)SVGAnimateTransformElement
(en-US)SVGCircleElement
(en-US)SVGClipPathElement
(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
SVGFontElement
(en-US) ObsoletoSVGFontFaceElement
(en-US) ObsoletoSVGFontFaceFormatElement
(en-US) ObsoletoSVGFontFaceNameElement
(en-US) ObsoletoSVGFontFaceSrcElement
(en-US) ObsoletoSVGFontFaceUriElement
(en-US) ObsoletoSVGForeignObjectElement
(en-US)SVGGElement
(en-US)SVGGeometryElement
(en-US)SVGGlyphElement
(en-US) ObsoletoSVGGlyphRefElement
(en-US) ObsoletoSVGGradientElement
(en-US)SVGGraphicsElement
(en-US)SVGHatchElement
ExperimentalSVGHatchpathElement
ExperimentalSVGHKernElement
(en-US) ObsoletoSVGImageElement
(en-US)SVGLinearGradientElement
(en-US)SVGLineElement
(en-US)SVGMarkerElement
(en-US) ExperimentalSVGMaskElement
(en-US)SVGMetadataElement
(en-US)SVGMissingGlyphElement
(en-US) ObsoletoSVGMPathElement
(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)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) ObsoletoSVGTSpanElement
(en-US)SVGUseElement
(en-US)SVGViewElement
(en-US)SVGVKernElement
(en-US) Obsoleto
Interfaces de tipo de datos SVG
Estas son las API de DOM para los tipos de datos utilizados en las definiciones de propiedades y atributos de SVG.
Tipos estáticos
SVGAngle
(en-US)SVGColor
ObsoletoSVGICCColor
ObsoletoSVGElementInstance
SVGElementInstanceList
SVGLength
(en-US)SVGLengthList
(en-US)SVGNameList
SVGNumber
(en-US)SVGNumberList
(en-US)SVGPaint
SVGPathSeg
ObsoletoSVGPathSegClosePath
ObsoletoSVGPathSegMovetoAbs
ObsoletoSVGPathSegMovetoRel
ObsoletoSVGPathSegLinetoAbs
ObsoletoSVGPathSegLinetoRel
ObsoletoSVGPathSegCurvetoCubicAbs
ObsoletoSVGPathSegCurvetoCubicRel
ObsoletoSVGPathSegCurvetoQuadraticAbs
ObsoletoSVGPathSegCurvetoQuadraticRel
ObsoletoSVGPathSegArcAbs
ObsoletoSVGPathSegArcRel
ObsoletoSVGPathSegLinetoHorizontalAbs
ObsoletoSVGPathSegLinetoHorizontalRel
ObsoletoSVGPathSegLinetoVerticalAbs
ObsoletoSVGPathSegLinetoVerticalRel
ObsoletoSVGPathSegCurvetoCubicSmoothAbs
ObsoletoSVGPathSegCurvetoCubicSmoothRel
ObsoletoSVGPathSegCurvetoQuadraticSmoothAbs
ObsoletoSVGPathSegCurvetoQuadraticSmoothRel
ObsoletoSVGPathSegList
ObsoletoSVGPoint
ObsoletoSVGPointList
(en-US) ObsoletoSVGPreserveAspectRatio
(en-US)SVGRect
(en-US) ObsoletoSVGStringList
(en-US)SVGTransform
(en-US)SVGTransformList
(en-US)
Tipos animados
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
ObsoletoSVGAnimatedPoints
(en-US)SVGAnimatedPreserveAspectRatio
(en-US)SVGAnimatedRect
(en-US)SVGAnimatedString
(en-US)SVGAnimatedTransformList
(en-US)
Interfaces relacionadas con SMIL
Otras interfaces SVG
GetSVGDocument
ShadowAnimation
SVGColorProfileRule
ObsoletoSVGCSSRule
ObsoletoSVGDocument
SVGException
ObsoletoSVGFitToViewBox
SVGLocatable
ObsoletoSVGRenderingIntent
(en-US) ObsoletoSVGUnitTypes
(en-US)SVGUseElementShadowRoot
SVGViewSpec
ObsoletoSVGZoomEvent
Obsoleto
Especificaciones
Specification |
---|
DOM Standard |