文档对象模型 (DOM)
文档对象模型 (DOM) 将 web 页面与到脚本或编程语言连接起来。通常是指 JavaScript,但将 HTML、SVG 或 XML 文档建模为对象并不是 JavaScript 语言的一部分。DOM 模型用一个逻辑树来表示一个文档,树的每个分支的终点都是一个节点 (node),每个节点都包含着对象 (objects)。DOM 的方法 (methods) 让你可以用特定方式操作这个树,用这些方法你可以改变文档的结构、样式或者内容。节点可以关联上事件处理器,一旦某一事件被触发了,那些事件处理器就会被执行。
这里还有一篇关于 DOM 的 介绍 。
DOM 接口
AbortController
AbortSignal
AbstractRange
(en-US)Attr
CDATASection
CharacterData
Comment
CustomEvent
Document
DocumentFragment
DocumentType
DOMError
已弃用DOMException
DOMImplementation
DOMParser
DOMPoint
DOMPointReadOnly
(en-US)DOMRect
DOMTokenList
Element
Event
EventTarget
HTMLCollection
MutationObserver
MutationRecord
NamedNodeMap
Node
NodeFilter
NodeIterator
NodeList
ProcessingInstruction
(en-US)Range
StaticRange
(en-US)Text
(en-US)TextDecoder
TextEncoder
TimeRanges
TreeWalker
XMLDocument
过时的 DOM 接口
DOM 模型已经被高度简化了。为此,以下出现在 DOM level 3 或更早的规范里的接口已经被移除了。现在不是非常确定是否有一些会被重新引进,但是当前应该把它们看作废弃的,应当避免使用:
DOMConfiguration
DOMErrorHandler
DOMImplementationList
DOMImplementationRegistry
DOMImplementationSource
DOMLocator
DOMObject
DOMSettableTokenList
DOMUserData
ElementTraversal
Entity
EntityReference
NameList
Notation
TypeInfo
UserDataHandler
HTML DOM
包含 HTML 的文档使用 Document
接口进行描述,该接口由 HTML 规范扩展,包含了各种特定于 HTML 的功能。特别是,Element
接口得到了增强,成为 HTMLElement
和各种子类,每个子类代表一个(或一系列密切相关的)元素。
HTML DOM API 提供对各种浏览器功能的访问,例如选项卡和窗口、CSS 样式和样式表、浏览器历史记录等。这些接口将在 HTML DOM API 中进一步讨论。
SVG 接口
SVG 元素接口
SVGAElement
SVGAltGlyphElement
已弃用SVGAltGlyphDefElement
已弃用SVGAltGlyphItemElement
已弃用SVGAnimationElement
(en-US)SVGAnimateElement
SVGAnimateColorElement
(en-US) 已弃用SVGAnimateMotionElement
(en-US)SVGAnimateTransformElement
(en-US)SVGCircleElement
SVGClipPathElement
(en-US)SVGComponentTransferFunctionElement
(en-US)SVGCursorElement
(en-US)SVGDefsElement
(en-US)SVGDescElement
(en-US)SVGElement
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) 已弃用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
SVGHatchElement
实验性SVGHatchpathElement
实验性SVGHKernElement
(en-US) 已弃用SVGImageElement
(en-US)SVGLinearGradientElement
(en-US)SVGLineElement
(en-US)SVGMarkerElement
(en-US) 实验性SVGMaskElement
(en-US)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)SVGStopElement
(en-US)SVGStyleElement
(en-US)SVGSVGElement
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)SVGViewElement
(en-US)SVGVKernElement
(en-US) 已弃用
SVG 数据类型接口
以下是 SVG 属性和属性定义中使用的数据类型的 DOM API。
静态类型
SVGAngle
(en-US)SVGColor
已弃用SVGICCColor
已弃用SVGElementInstance
SVGElementInstanceList
SVGLength
(en-US)SVGLengthList
(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
(en-US) 已弃用SVGPreserveAspectRatio
(en-US)SVGRect
(en-US) 已弃用SVGStringList
(en-US)SVGTransform
(en-US)SVGTransformList
(en-US)
动画类型
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 相关接口
其他的 SVG 接口
规范
Specification |
---|
DOM Standard |