Document 接口表示在浏览器中加载的任何网页,并充当网页内容的入口点,其是 DOM 树 . DOM 树包括元素如 <body> and <table> , among 很多其它 。它为文档提供全局功能,像如何获得页面的 URL 和在文档中创建新元素。

  <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="../API/EventTarget.html" target="_top"><rect x="1" y="1" width="110" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text  x="56" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">EventTarget</text></a><polyline points="111,25  121,20  121,30  111,25" stroke="#D4DDE4" fill="none"/><line x1="121" y1="25" x2="151" y2="25" stroke="#D4DDE4"/><a xlink:href="../API/Node" target="_top"><rect x="151" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text  x="188.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Node</text></a><polyline points="226,25  236,20  236,30  226,25" stroke="#D4DDE4" fill="none"/><line x1="236" y1="25" x2="266" y2="25" stroke="#D4DDE4"/><a xlink:href="../API/Document" target="_top"><rect x="266" y="1" width="80" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text  x="306" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Document</text></a></svg></div>
					
  a:hover text { fill: #0095DD; pointer-events: all;}
					

Document 接口描述任何种类文档的常见特性和方法。取决于文档的类型 (如 HTML , XML ,SVG,…),可用的更大 API:HTML 文档,服务于 "text/html" 内容类型,还实现 HTMLDocument 接口,而 XML 和 SVG 文档实现 XMLDocument 接口。

构造函数

Document()
创建新的 Document 对象。

特性

此接口还继承 节点 and EventTarget 接口。

Document.anchors 只读

返回文档中所有锚点的列表。

Document.body
返回 <body> or <frameset> 节点在当前文档。
Document.characterSet 只读

返回由文档所使用的字符集。

Document.compatMode 只读
指示文档呈现是否在 quirks or strict 模式。
Document.contentType 只读

返回来自当前文档 MIME 头的 Content-Type。

Document.doctype 只读

返回当前文档的 DTD (文档类型定义)。

Document.documentElement 只读
返回 元素 ,它是文档的直接子级。对于 HTML 文档,这通常是 HTMLHtmlElement 对象,表示文档的 <html> 元素。
Document.documentURI 只读

以字符串形式返回文档位置。

Document.embeds 只读
返回列表为嵌入式 <embed> 元素在当前文档中。
Document.fonts
返回 FontFaceSet 接口在当前文档。
Document.forms 只读
返回列表为 <form> 元素在当前文档中。
Document.head 只读
返回 <head> 元素在当前文档。
Document.hidden 只读

返回指示页面是否被视为隐藏的布尔值。

Document.images 只读

返回当前文档中的图像列表。

Document.implementation 只读

返回关联当前文档的 DOM 实现。

Document.lastStyleSheetSet 只读
返回上次启用的样式表集的名称。拥有值 null 直到样式表被改变通过设置值为 selectedStyleSheetSet .
Document.links 只读

返回文档中所有超链接的列表。

Document.mozSyntheticDocument
返回 布尔 也就是 true 仅当此文档是合成的,如独立图像、视频、音频文件或类似的。
Document.plugins 只读

返回可用插件的列表。

Document.featurePolicy 只读
返回 FeaturePolicy 接口,提供简单 API 用于自省被应用于特定文档的特征策略。
Document.preferredStyleSheetSet 只读

返回由页面作者指定的首选样式表集。

Document.scripts 只读
返回所有 <script> 元素在文档。
Document.scrollingElement 只读
返回引用针对 元素 卷动文档。
Document.selectedStyleSheetSet

返回目前在使用的样式表集。

Document.styleSheetSets 只读

返回文档中可用的样式表集的列表。

Document.timeline 只读
返回时间线作为特殊实例为 DocumentTimeline 它是在页面加载时自动创建的。
Document.undoManager 只读

Document.visibilityState 只读
返回 string denoting the visibility state of the document. Possible values are visible , hidden , prerender ,和 unloaded .

Document 接口扩展通过 ParentNode 接口:

ParentNode.childElementCount 只读
Returns the number of children of this ParentNode which are elements.
ParentNode.children 只读
返回实时 HTMLCollection 包含所有的 元素 对象,其是子级在此 ParentNode ,省略其所有非元素节点。
ParentNode.firstElementChild 只读
Returns the first node which is both a child of this ParentNode and is also an 元素 ,或 null 若没有。
ParentNode.lastElementChild 只读
Returns the last node which is both a child of this ParentNode and 元素 ,或 null 若没有。

HTMLDocument 扩展

Document HTML 文档接口继承自 HTMLDocument 接口或从 HTML5 起,有为这种文档进行扩展。

Document.cookie

返回此文档以分号分隔的 Cookie 列表或设置的单个 Cookie。

Document.defaultView 只读

返回对窗口对象的引用。

Document.designMode

获取/设置编辑整个文档的能力。

Document.dir 只读

获取/设置文档的方向性 (从右到左/从左到右)。

Document.domain

获取/设置当前文档的域。

Document.lastModified 只读

返回上次修改文档的日期。

Document.location 只读

返回当前文档的 URI。

Document.readyState 只读

返回文档的加载状态。

Document.referrer 只读

返回链接到此页面的页面 URI。

Document.title

设置或获取当前文档的标题。

Document.URL 只读

以字符串形式返回文档位置。

包括特性来自 DocumentOrShadowRoot

Document 接口包括的以下特性定义在 DocumentOrShadowRoot mixin. Note that this is currently only implemented by Chrome; other browsers still implement them directly on the Document 接口。

DocumentOrShadowRoot.activeElement 只读
返回 元素 within the shadow tree that has focus.
Document.fullscreenElement 只读

The element that's currently in full screen mode for this document.

DocumentOrShadowRoot.pointerLockElement 只读
Returns the element set as the target for mouse events while the pointer is locked. null if lock is pending, pointer is unlocked, or if the target is in another document.
DocumentOrShadowRoot.styleSheets 只读
返回 StyleSheetList of CSSStyleSheet objects for stylesheets explicitly linked into, or embedded in a document.

事件处理程序

Document.onafterscriptexecute
表示事件处理代码为 afterscriptexecute 事件。
Document.onbeforescriptexecute
表示事件处理代码为 beforescriptexecute 事件。
Document.oncopy
表示事件处理代码为 copy 事件。
Document.oncut
表示事件处理代码为 cut 事件。
Document.onfullscreenchange
EventHandler 表示要调用的代码当 fullscreenchange 事件被引发。
Document.onfullscreenerror
EventHandler 表示要调用的代码当 fullscreenerror 事件被引发。
Document.onpaste
表示事件处理代码为 paste 事件。
Document.onreadystatechange
表示事件处理代码为 readystatechange 事件。
Document.onselectionchange
EventHandler 表示要调用的代码当 selectionchange 事件被引发。
Document.onvisibilitychange
EventHandler 表示要调用的代码当 visibilitychange 事件被引发。

Document 接口扩展通过 GlobalEventHandlers 接口:

GlobalEventHandlers.onabort
EventHandler 表示要调用的代码当 abort 事件被引发。
GlobalEventHandlers.onanimationcancel
EventHandler 被调用当 animationcancel event is sent, indicating that a running CSS animation has been canceled.
GlobalEventHandlers.onanimationend
EventHandler 被调用当 animationend 事件被发送,指示 CSS animation has stopped playing.
GlobalEventHandlers.onanimationiteration
EventHandler 被调用当 animationiteration event has been sent, indicating that a CSS animation has begun playing a new iteration of the animation sequence.
GlobalEventHandlers.onanimationstart
EventHandler 被调用当 animationstart 事件被发送,指示 CSS animation has started playing.
GlobalEventHandlers.onauxclick
EventHandler 被调用当 auxclick event is sent, indicating that a non-primary button has been pressed on an input device (e.g. a middle mouse button).
GlobalEventHandlers.onblur
EventHandler 表示要调用的代码当 blur 事件被引发。
GlobalEventHandlers.onerror
OnErrorEventHandler 表示要调用的代码当 error 事件被引发。
GlobalEventHandlers.onfocus
EventHandler 表示要调用的代码当 focus 事件被引发。
GlobalEventHandlers.oncancel
EventHandler 表示要调用的代码当 cancel 事件被引发。
GlobalEventHandlers.oncanplay
EventHandler 表示要调用的代码当 canplay 事件被引发。
GlobalEventHandlers.oncanplaythrough
EventHandler 表示要调用的代码当 canplaythrough 事件被引发。
GlobalEventHandlers.onchange
EventHandler 表示要调用的代码当 change 事件被引发。
GlobalEventHandlers.onclick
EventHandler 表示要调用的代码当 click 事件被引发。
GlobalEventHandlers.onclose
EventHandler 表示要调用的代码当 close 事件被引发。
GlobalEventHandlers.oncontextmenu
EventHandler 表示要调用的代码当 contextmenu 事件被引发。
GlobalEventHandlers.oncuechange
EventHandler 表示要调用的代码当 cuechange 事件被引发。
GlobalEventHandlers.ondblclick
EventHandler 表示要调用的代码当 dblclick 事件被引发。
GlobalEventHandlers.ondrag
EventHandler 表示要调用的代码当 drag 事件被引发。
GlobalEventHandlers.ondragend
EventHandler 表示要调用的代码当 dragend 事件被引发。
GlobalEventHandlers.ondragenter
EventHandler 表示要调用的代码当 dragenter 事件被引发。
GlobalEventHandlers.ondragexit
EventHandler 表示要调用的代码当 dragexit 事件被引发。
GlobalEventHandlers.ondragleave
EventHandler 表示要调用的代码当 dragleave 事件被引发。
GlobalEventHandlers.ondragover
EventHandler 表示要调用的代码当 dragover 事件被引发。
GlobalEventHandlers.ondragstart
EventHandler 表示要调用的代码当 dragstart 事件被引发。
GlobalEventHandlers.ondrop
EventHandler 表示要调用的代码当 drop 事件被引发。
GlobalEventHandlers.ondurationchange
EventHandler 表示要调用的代码当 durationchange 事件被引发。
GlobalEventHandlers.onemptied
EventHandler 表示要调用的代码当 emptied 事件被引发。
GlobalEventHandlers.onended
EventHandler 表示要调用的代码当 ended 事件被引发。
GlobalEventHandlers.onformdata
EventHandler 为处理 formdata events, fired after the entry list representing the form's data is constructed.
GlobalEventHandlers.ongotpointercapture
EventHandler 表示要调用的代码当 gotpointercapture 事件类型被引发。
GlobalEventHandlers.oninput
EventHandler 表示要调用的代码当 input 事件被引发。
GlobalEventHandlers.oninvalid
EventHandler 表示要调用的代码当 无效 事件被引发。
GlobalEventHandlers.onkeydown
EventHandler 表示要调用的代码当 keydown 事件被引发。
GlobalEventHandlers.onkeypress
EventHandler 表示要调用的代码当 keypress 事件被引发。
GlobalEventHandlers.onkeyup
EventHandler 表示要调用的代码当 keyup 事件被引发。
GlobalEventHandlers.onload
EventHandler 表示要调用的代码当 load 事件被引发。
GlobalEventHandlers.onloadeddata
EventHandler 表示要调用的代码当 loadeddata 事件被引发。
GlobalEventHandlers.onloadedmetadata
EventHandler 表示要调用的代码当 loadedmetadata 事件被引发。
GlobalEventHandlers.onloadend
EventHandler 表示要调用的代码当 loadend 事件被引发 (当资源加载进度停止时。)
GlobalEventHandlers.onloadstart
EventHandler 表示要调用的代码当 loadstart 事件被引发 (当资源加载进度开始时。)
GlobalEventHandlers.onlostpointercapture
EventHandler 表示要调用的代码当 lostpointercapture 事件类型被引发。
GlobalEventHandlers.onmousedown
EventHandler 表示要调用的代码当 mousedown 事件被引发。
GlobalEventHandlers.onmouseenter
EventHandler 表示要调用的代码当 mouseenter 事件被引发。
GlobalEventHandlers.onmouseleave
EventHandler 表示要调用的代码当 mouseleave 事件被引发。
GlobalEventHandlers.onmousemove
EventHandler 表示要调用的代码当 mousemove 事件被引发。
GlobalEventHandlers.onmouseout
EventHandler 表示要调用的代码当 mouseout 事件被引发。
GlobalEventHandlers.onmouseover
EventHandler 表示要调用的代码当 mouseover 事件被引发。
GlobalEventHandlers.onmouseup
EventHandler 表示要调用的代码当 mouseup 事件被引发。
GlobalEventHandlers.onmousewheel
EventHandler 表示要调用的代码当 mousewheel 事件被引发。弃用。使用 onwheel 代替。
GlobalEventHandlers.onwheel
EventHandler 表示要调用的代码当 wheel 事件被引发。
GlobalEventHandlers.onpause
EventHandler 表示要调用的代码当 pause 事件被引发。
GlobalEventHandlers.onplay
EventHandler 表示要调用的代码当 play 事件被引发。
GlobalEventHandlers.onplaying
EventHandler 表示要调用的代码当 playing 事件被引发。
GlobalEventHandlers.onpointerdown
EventHandler 表示要调用的代码当 pointerdown 事件被引发。
GlobalEventHandlers.onpointermove
EventHandler 表示要调用的代码当 pointermove 事件被引发。
GlobalEventHandlers.onpointerup
EventHandler 表示要调用的代码当 pointerup 事件被引发。
GlobalEventHandlers.onpointercancel
EventHandler 表示要调用的代码当 pointercancel 事件被引发。
GlobalEventHandlers.onpointerover
EventHandler 表示要调用的代码当 pointerover 事件被引发。
GlobalEventHandlers.onpointerout
EventHandler 表示要调用的代码当 pointerout 事件被引发。
GlobalEventHandlers.onpointerenter
EventHandler 表示要调用的代码当 pointerenter 事件被引发。
GlobalEventHandlers.onpointerleave
EventHandler 表示要调用的代码当 pointerleave 事件被引发。
GlobalEventHandlers.onpointerlockchange
EventHandler 表示要调用的代码当 pointerlockchange 事件被引发。
GlobalEventHandlers.onpointerlockerror
EventHandler 表示要调用的代码当 pointerlockerror 事件被引发。
GlobalEventHandlers.onprogress
EventHandler 表示要调用的代码当 progress 事件被引发。
GlobalEventHandlers.onratechange
EventHandler 表示要调用的代码当 ratechange 事件被引发。
GlobalEventHandlers.onreset
EventHandler 表示要调用的代码当 reset 事件被引发。
GlobalEventHandlers.onresize
EventHandler 表示要调用的代码当 resize 事件被引发。
GlobalEventHandlers.onscroll
EventHandler 表示要调用的代码当 scroll 事件被引发。
GlobalEventHandlers.onseeked
EventHandler 表示要调用的代码当 seeked 事件被引发。
GlobalEventHandlers.onseeking
EventHandler 表示要调用的代码当 seeking 事件被引发。
GlobalEventHandlers.onselect
EventHandler 表示要调用的代码当 select 事件被引发。
GlobalEventHandlers.onselectstart
EventHandler 表示要调用的代码当 selectionchange event is raised, i.e. when the user starts to make a new text selection on a web page.
GlobalEventHandlers.onselectionchange
EventHandler 表示要调用的代码当 selectionchange event is raised, i.e. when the text selected on a web page changes.
GlobalEventHandlers.onshow
EventHandler 表示要调用的代码当 show 事件被引发。
GlobalEventHandlers.onsort
EventHandler 表示要调用的代码当 sort 事件被引发。
GlobalEventHandlers.onstalled
EventHandler 表示要调用的代码当 stalled 事件被引发。
GlobalEventHandlers.onsubmit
EventHandler 表示要调用的代码当 submit 事件被引发。
GlobalEventHandlers.onsuspend
EventHandler 表示要调用的代码当 suspend 事件被引发。
GlobalEventHandlers.ontimeupdate
EventHandler 表示要调用的代码当 timeupdate 事件被引发。
GlobalEventHandlers.onvolumechange
EventHandler 表示要调用的代码当 volumechange 事件被引发。
GlobalEventHandlers.ontouchcancel
EventHandler 表示要调用的代码当 touchcancel 事件被引发。
GlobalEventHandlers.ontouchend
EventHandler 表示要调用的代码当 touchend 事件被引发。
GlobalEventHandlers.ontouchmove
EventHandler 表示要调用的代码当 touchmove 事件被引发。
GlobalEventHandlers.ontouchstart
EventHandler 表示要调用的代码当 touchstart 事件被引发。
GlobalEventHandlers.ontransitioncancel
EventHandler 被调用当 transitioncancel 事件被发送,指示 CSS transition 已被取消。
GlobalEventHandlers.ontransitionend
EventHandler 被调用当 transitionend 事件被发送,指示 CSS transition 已完成播放。
GlobalEventHandlers.ontransitionrun
EventHandler 被调用当 transitionrun 事件被发送,指示 CSS transition is running, though not nessarilty started.
GlobalEventHandlers.ontransitionstart
EventHandler 被调用当 transitionstart 事件被发送,指示 CSS transition 已开始过渡。
GlobalEventHandlers.onwaiting
EventHandler 表示要调用的代码当 waiting 事件被引发。

弃用特性

Document.alinkColor

Returns or sets the color of active links in the document body.

Document.all
Provides access to all elements in the document — it returns an HTMLAllCollection rooted at the document node. This is a legacy, non-standard property and should not be used.
Document.applets 只读

Returns an ordered list of the applets within a document.

Document.bgColor

Gets/sets the background color of the current document.

Document.charset 只读
别名化的 Document.characterSet . Use this property instead.
Document.domConfig
应该返回 DOMConfiguration 对象。
Document.fgColor

Gets/sets the foreground color, or text color, of the current document.

Document.fullscreen
true when the document is in full-screen mode .
Document.height

Gets/sets the height of the current document.

Document.inputEncoding 只读
别名化的 Document.characterSet . Use this property instead.
Document.linkColor

Gets/sets the color of hyperlinks in the document.

Document.rootElement
Document.documentElement , but only for <svg> root elements. Use this property instead.
Document.vlinkColor

Gets/sets the color of visited hyperlinks.

Document.width

Returns the width of the current document.

Document.xmlEncoding

Returns the encoding as determined by the XML declaration.

Document.xmlStandalone 从 Gecko 10 起已过时
返回 true if the XML declaration specifies the document to be standalone ( e.g., An external part of the DTD affects the document's content), else false .
Document.xmlVersion 从 Gecko 10 起已过时
Returns the version number as specified in the XML declaration or "1.0" if the declaration is absent.

方法

此接口还继承 节点 and EventTarget 接口。

Document.adoptNode()

从外部文档采纳节点。

Document.captureEvents()
Window.captureEvents .
Document.caretRangeFromPoint()
获取 范围 object for the document fragment under the specified coordinates.
Document.createAttribute()
创建新的 Attr 对象并返回它。
Document.createAttributeNS()

Creates a new attribute node in a given namespace and returns it.

Document.createCDATASection()

创建新 CDATA 节点并返回它。

Document.createComment()

创建新注释节点并返回它。

Document.createDocumentFragment()

创建新文档片段。

Document.createElement()

采用给定标签名称创建新元素。

Document.createElementNS()

采用给定标签名称和名称空间 URI 创建新元素。

Document.createEntityReference()

Creates a new entity reference object and returns it.

Document.createEvent()

创建事件对象。

Document.createNodeIterator()
创建 NodeIterator 对象。
Document.createProcessingInstruction()
创建新的 ProcessingInstruction 对象。
Document.createRange()
创建 范围 对象。
Document.createTextNode()

创建文本节点。

Document.createTouch()
创建 触摸 对象。
Document.createTouchList()
创建 TouchList 对象。
Document.createTreeWalker()
创建 TreeWalker 对象。
Document.enableStyleSheetsForSet()

Enables the style sheets for the specified style sheet set.

Document.exitPointerLock()

释放指针锁。

Document.getAnimations()
返回数组包含所有 动画 objects currently in effect, whose target elements are descendants of the document .
Document.getElementsByClassName()

返回具有给定类名的元素列表。

Document.getElementsByTagName()

返回具有给定标签名称的元素列表。

Document.getElementsByTagNameNS()

返回具有给定标签名称和名称空间的元素列表。

Document.hasStorageAccess()
返回 Promise that resolves with a boolean value indicating whether the document has access to its first-party storage.
Document.importNode()

返回来自外部文档的节点克隆。

Document.normalizeDocument()

Replaces entities, normalizes text nodes, etc.

Document.releaseCapture()

Releases the current mouse capture if it's on an element in this document.

Document.releaseEvents()
Window.releaseEvents() .
Document.requestStorageAccess()
返回 Promise that resolves if the access to first-party storage was granted, and rejects if access was denied.
Document.routeEvent() 从 Gecko 24 起已过时
Window.routeEvent() .
Document.mozSetImageElement()

Allows you to change the element being used as the background image for a specified element ID.

Document 接口扩展通过 ParentNode 接口:

document.getElementById(String id)

返回标识元素的对象引用。

Document.querySelector()

返回在文档中匹配指定选择器的第一元素节点,按文档顺序。

Document.querySelectorAll()

返回在文档中匹配指定选择器的所有元素节点的列表。

Document 接口扩展通过 XPathEvaluator 接口:

Document.createExpression()
编译 XPathExpression which can then be used for (repeated) evaluations.
Document.createNSResolver()
创建 XPathNSResolver 对象。
Document.evaluate()

评估 XPath 表达式。

HTML 文档扩展

Document HTML 文档接口继承自 HTMLDocument 接口或从 HTML5 起,对这种文档进行扩展:

Document.clear()

在大多数现代浏览器中 (包括最近版本的 Firefox 和 Internet Explorer),此方法什么都不做。

Document.close()

关闭用于写入的文档流。

Document.execCommand()

在可编辑文档中,执行格式化命令。

Document.getElementsByName()

返回采用给定名称的元素列表。

Document.hasFocus()
返回 true 若聚焦目前位于指定文档内的任何位置。
Document.open()

打开用于写入的文档流。

Document.queryCommandEnabled()

Returns true if the formating command can be executed on the current range.

Document.queryCommandIndeterm()

Returns true if the formating command is in an indeterminate state on the current range.

Document.queryCommandState()

Returns true if the formating command has been executed on the current range.

Document.queryCommandSupported()

Returns true if the formating command is supported on the current range.

Document.queryCommandValue()

Returns the current value of the current range for a formating command.

Document.write()

在文档中写入文本。

Document.writeln()

在文档中写入一行文本。

包括方法来自 DocumentOrShadowRoot

Document 接口包括的以下方法定义在 DocumentOrShadowRoot mixin. Note that this is currently only implemented by Chrome; other browsers still implement them on the Document 接口。

DocumentOrShadowRoot.getSelection()
返回 Selection 对象,表示用户选择的文本范围或 ^ 插入符号的当前位置。
DocumentOrShadowRoot.elementFromPoint()

Returns the topmost element at the specified coordinates.

DocumentOrShadowRoot.elementsFromPoint()

Returns an array of all elements at the specified coordinates.

DocumentOrShadowRoot.caretPositionFromPoint()
返回 CaretPosition object containing the DOM node containing the caret, and caret's character offset within that node.

事件

监听这些事件使用 addEventListener() 或通过把事件监听器赋值给 on eventname 特性为此接口。

scroll
被激发当文档视图或元素已被卷动。
也可用凭借 onscroll 特性。
visibilitychange
Fired when the content of a tab has become visible or has been hidden.
也可用凭借 onvisibilitychange 特性。
wheel
Fired when the user rotates a wheel button on a pointing device (typically a mouse).
也可用凭借 onwheel 特性。

动画事件

animationcancel
被激发当动画意外中止。
也可用凭借 onanimationcancel 特性。
animationend
被激发当动画已正常完成。
也可用凭借 onanimationend 特性。
animationiteration
被激发当动画迭代已完成。
也可用凭借 onanimationiteration 特性。
animationstart
被激发当动画开始。
也可用凭借 onanimationstart 特性。

剪贴板事件

copy
Fired when the user initiates a copy action through the browser's user interface.
也可用凭借 oncopy 特性。
cut
Fired when the user initiates a cut action through the browser's user interface.
也可用凭借 oncut 特性。
paste
Fired when the user initiates a paste action through the browser's user interface.
也可用凭借 onpaste 特性。

拖拽 & 掉落事件

drag
Fired every few hundred milliseconds as an element or text selection is being dragged by the user.
也可用凭借 ondrag 特性。
dragend
Fired when a drag operation is being ended (by releasing a mouse button or hitting the escape key).
也可用凭借 ondragend 特性。
dragenter
Fired when a dragged element or text selection enters a valid drop target.
也可用凭借 ondragenter 特性。
dragexit
Fired when an element is no longer the drag operation's immediate selection target.
也可用凭借 ondragexit 特性。
dragleave
Fired when a dragged element or text selection leaves a valid drop target.
也可用凭借 ondragleave 特性。
dragover
Fired when an element or text selection is being dragged over a valid drop target (every few hundred milliseconds).
也可用凭借 ondragover 特性。
dragstart
Fired when the user starts dragging an element or text selection.
也可用凭借 ondragstart 特性。
drop
Fired when an element or text selection is dropped on a valid drop target.
也可用凭借 ondrop 特性。

全屏事件

fullscreenchange
被激发当 Document 进入或退出 full-screen 模式。
也可用凭借 onfullscreenchange 特性。
fullscreenerror
被激发若发生错误当尝试切入或退出 full-screen 模式。
也可用凭借 onfullscreenerror 特性。

键盘事件

keydown
被激发当键被按下。
也可用凭借 onkeydown 特性。
keypress
被激发当按下产生字符值的键时。
也可用凭借 onkeypress 特性。
keyup
被激发当键被释放。
也可用凭借 onkeyup 特性。

加载 & 卸载事件

DOMContentLoaded

被激发当文档已完全加载并剖析,无需等待样式表、图像及子框架完成加载。

readystatechange
被激发当 readyState 文档属性有改变。
也可用凭借 onreadystatechange 特性。

指针事件

gotpointercapture
Fired when when an element captures a pointer using setPointerCapture() .
也可用凭借 ongotpointercapture 特性。
lostpointercapture
被激发当 捕获指针 被释放。
也可用凭借 onlostpointercapture 特性。
pointercancel
被激发当指针事件被取消。
也可用凭借 onpointercancel 特性。
pointerdown
被激发当指针变为活动。
也可用凭借 onpointerdown 特性。
pointerenter
Fired when a pointer is moved into the hit test boundaries of an element or one of its descendants.
也可用凭借 onpointerenter 特性。
pointerleave
Fired when a pointer is moved out of the hit test boundaries of an element.
也可用凭借 onpointerleave 特性。
pointerlockchange
Fired when the pointer is locked/unlocked.
也可用凭借 onpointerlockchange 特性。
pointerlockerror
Fired when locking the pointer failed.
也可用凭借 onpointerlockerror 特性。
pointermove
被激发当指针改变坐标时。
也可用凭借 onpointermove 特性。
pointerout
Fired when a pointer is moved out of the hit test boundaries of an element (among other reasons).
也可用凭借 onpointerout 特性。
pointerover
Fired when a pointer is moved into an element's hit test boundaries.
也可用凭借 onpointerover 特性。
pointerup
Fired when a pointer is no longer active.
也可用凭借 onpointerup 特性。

选择事件

selectionchange
Fired when the current text selection on a document is changed.
也可用凭借 onselectionchange 特性。
selectstart
Fired when the user begins a new selection.
也可用凭借 onselectstart 特性。

触摸事件

touchcancel
Fired when one or more touch points have been disrupted in an implementation-specific manner (for example, too many touch points are created).
也可用凭借 ontouchcancel 特性。
touchend
Fired when one or more touch points are removed from the touch surface.
也可用凭借 ontouchend property
touchmove
Fired when one or more touch points are moved along the touch surface.
也可用凭借 ontouchmove property
touchstart
Fired when one or more touch points are placed on the touch surface.
也可用凭借 ontouchstart property

过渡事件

transitioncancel
被激发当 CSS transition 被取消。
也可用凭借 ontransitioncancel 特性。
transitionend
被激发当 CSS transition 已完成。
也可用凭借 ontransitionend 特性。
transitionrun
被激发当 CSS transition is first created.
也可用凭借 ontransitionrun 特性。
transitionstart
被激发当 CSS transition has actually started.
也可用凭借 ontransitionstart 特性。

非标扩展

非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

Firefox 注意事项

Mozilla 定义的一组仅用于 XUL 内容的非标准特性:

Document.currentScript
返回 <script> element that is currently executing.
Document.documentURIObject
( Mozilla add-ons only! ) Returns the nsIURI object representing the URI of the document. This property only has special meaning in privileged JavaScript code (with UniversalXPConnect privileges).
Document.popupNode

Returns the node upon which a popup was invoked.

Document.tooltipNode

Returns the node which is the target of the current tooltip.

Mozilla also define some non-standard methods:

Document.execCommandShowHelp() 从 Gecko 14 起已过时

This method never did anything and always threw an exception, so it was removed in Gecko 14.0 (Firefox 14.0 / Thunderbird 14.0 / SeaMonkey 2.11).

Document.getBoxObjectFor()
使用 Element.getBoundingClientRect() method instead.
Document.loadOverlay() 从 Gecko 61 起已过时
Loads a XUL overlay dynamically. This only works in XUL documents.
Document.queryCommandText() 从 Gecko 14 起已过时

This method never did anything but throw an exception, and was removed in Gecko 14 (Firefox 14 / Thunderbird 14 / SeaMonkey 2.11).

Internet Explorer 注意事项

微软定义的一些非标准特性:

Document.fileSize *
Returns size in bytes of the document. Starting with Internet Explorer 11, that property is no longer supported. See MSDN .

Internet Explorer does not support all methods from the 节点 interface in the Document 接口:

Document.contains
As a work-around, document.body.contains() 可以使用。

规范

规范 状态 注释
DOM
在该规范中的 Document 定义。
实时标准 打算取代 DOM 3
HTML 实时标准
在该规范中的 Document 定义。
实时标准 Turn the HTMLDocument interface into a Document extension.
CSSOM (CSS 对象模型) 视图模块
在该规范中的 Document 定义。
工作草案 Extend the Document interface
指针锁
在该规范中的 Document 定义。
候选推荐 Extend the Document interface
Page Visibility (Second Edition)
在该规范中的 Document 定义。
推荐 Extend the Document interface with the visibilityState and hidden attributes and the onvisibilitychange event listener.
选定 API
在该规范中的 Document 定义。
工作草案 添加 getSelection() , onselectstart and onselectionchange .
DOM4
在该规范中的 Document 定义。
过时 取代 DOM 3
DOM (文档对象模型) 3 级核心规范
在该规范中的 Document 定义。
过时 取代 DOM 2
DOM (文档对象模型) 3 级 XPath 规范
在该规范中的 XPathEvaluator 定义。
推荐 定义 XPathEvaluator 接口扩展文档。
DOM (文档对象模型) 级别 2 核心规范
在该规范中的 Document 定义。
过时 取代 DOM 1
DOM (文档对象模型) 1 级规范
在该规范中的 Document 定义。
过时 接口的初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
Document Chrome 1 Edge 12 Firefox 1 IE 4 Opera 3 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
Document() 构造函数 Chrome 60 Edge ≤18 Firefox Yes IE No Opera 47 Safari Yes WebView Android 60 Chrome Android 60 Firefox Android Yes Opera Android 44 Safari iOS Yes Samsung Internet Android 8.0
DOMContentLoaded event Chrome 1 Edge 12 Firefox 1 IE 9 Opera 9 Safari 3.1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 2 Samsung Internet Android 1.0
URL Chrome 1 Edge 12 Firefox Yes IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
adoptNode Chrome 1 Edge 12 Firefox Yes IE 9 Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
alinkColor 弃用 非标 Chrome 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Chrome Android 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 9.0
9.0
Before Samsung Internet 9.0, this property was accessed through the HTMLDocument 别名。
all 非标 Chrome 64
64
Starting in Chrome 65, this property is readonly.
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 64
64
Starting in Chrome 65, this property is readonly.
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Chrome Android 64
64
Starting in Chrome 65, this property is readonly.
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 9.0
9.0
Starting in Samsung Internet 9.0, this property is readonly.
Before Samsung Internet 9.0, this property was accessed through the HTMLDocument 别名。
anchors 弃用 Chrome 1 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
animationcancel event Chrome No Edge No Firefox 54 IE No Opera No Safari 13.1
13.1
12 Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
WebView Android No Chrome Android No Firefox Android 54 Opera Android No Safari iOS 13.4
13.4
12 Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
Samsung Internet Android No
animationend event Chrome 43 Edge 12 Firefox Yes IE 10 Opera 30 Safari 9 WebView Android 43 Chrome Android 43 Firefox Android Yes Opera Android 30 Safari iOS 9 Samsung Internet Android 4.0
animationiteration event Chrome 43 Edge 12 Firefox 51 IE 10 Opera 30 Safari 9 WebView Android 43 Chrome Android 43 Firefox Android 51 Opera Android 30 Safari iOS 9 Samsung Internet Android 4.0
animationstart event Chrome 43 Edge 12 Firefox 51 IE 10 Opera 30 Safari 9 WebView Android 43 Chrome Android 43 Firefox Android 51 Opera Android 30 Safari iOS 9 Samsung Internet Android 4.0
applets 弃用 Chrome 1 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
bgColor 弃用 非标 Chrome 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Chrome Android 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 9.0
9.0
Before Samsung Internet 9.0, this property was accessed through the HTMLDocument 别名。
body Chrome 1 Edge 12 Firefox 2
2
body property was implemented on the HTMLDocument interface in Firefox for a long time, hence document.body would not return the <body> element if the document's Content-Type was not set to text/html or application/xhtml+xml (or if it came from DOMParser.parseFromString 不带 text/html type being used). This has been fixed in Firefox 60.
IE 6 Opera 9.6 Safari 4 WebView Android ≤37 Chrome Android 18 Firefox Android 4
4
body property was implemented on the HTMLDocument interface in Firefox for a long time, hence document.body would not return the <body> element if the document's Content-Type was not set to text/html or application/xhtml+xml (or if it came from DOMParser.parseFromString 不带 text/html type being used). This has been fixed in Firefox 60.
Opera Android 10.1 Safari iOS 5 Samsung Internet Android 1.0
captureEvents 弃用 非标 Chrome 64
64
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 64
64
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Chrome Android 64
64
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 9.0
9.0
Before Samsung Internet 9.0, this method was accessed through the HTMLDocument 别名。
caretRangeFromPoint 非标 Chrome 8 Edge 12 Firefox No IE No Opera 15 Safari Yes WebView Android Yes Chrome Android Yes Firefox Android No Opera Android 14 Safari iOS Yes Samsung Internet Android Yes
characterSet Chrome 1
1
1 Alternate Name
charset alias was made read-only in Chrome 45.
Alternate Name Uses the non-standard name: charset
1 Alternate Name
Alternate Name Uses the non-standard name: inputEncoding
Edge ≤79
≤79
≤79 Alternate Name
Alternate Name Uses the non-standard name: charset
≤79 Alternate Name
Alternate Name Uses the non-standard name: inputEncoding
Firefox Yes
Yes
44 Alternate Name
Alternate Name Uses the non-standard name: charset
Yes Alternate Name
Alternate Name Uses the non-standard name: inputEncoding
IE ?
?
? Alternate Name
Alternate Name Uses the non-standard name: charset
? Alternate Name
Alternate Name Uses the non-standard name: inputEncoding
Opera Yes
Yes
? Alternate Name
Alternate Name Uses the non-standard name: charset
? Alternate Name
Alternate Name Uses the non-standard name: inputEncoding
Safari Yes
Yes
9 Alternate Name
Alternate Name Uses the non-standard name: charset
? Alternate Name
Alternate Name Uses the non-standard name: inputEncoding
WebView Android 45
45
Yes Alternate Name
charset alias was made read-only in WebView 45.
Alternate Name Uses the non-standard name: charset
Yes Alternate Name
Alternate Name Uses the non-standard name: inputEncoding
Chrome Android 45
45
Yes Alternate Name
charset alias was made read-only in Chrome 45.
Alternate Name Uses the non-standard name: charset
Yes Alternate Name
Alternate Name Uses the non-standard name: inputEncoding
Firefox Android Yes
Yes
44 Alternate Name
Alternate Name Uses the non-standard name: charset
Yes Alternate Name
Alternate Name Uses the non-standard name: inputEncoding
Opera Android Yes
Yes
? Alternate Name
Alternate Name Uses the non-standard name: charset
? Alternate Name
Alternate Name Uses the non-standard name: inputEncoding
Safari iOS Yes
Yes
? Alternate Name
Alternate Name Uses the non-standard name: charset
? Alternate Name
Alternate Name Uses the non-standard name: inputEncoding
Samsung Internet Android 5.0
5.0
Yes Alternate Name
charset alias was made read-only in Samsung Internet 5.0.
Alternate Name Uses the non-standard name: charset
Yes Alternate Name
Alternate Name Uses the non-standard name: inputEncoding
clear 弃用 非标 Chrome 64
64
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 64
64
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Chrome Android 64
64
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 9.0
9.0
Before Samsung Internet 9.0, this method was accessed through the HTMLDocument 别名。
close Chrome 45
45
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 45
45
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Chrome Android 45
45
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
5.0
Before Samsung Internet 9.0, this method was accessed through the HTMLDocument 别名。
compatMode 非标 Chrome 43 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 43 Chrome Android 43 Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 4.0
包含 Chrome Yes Edge ≤79 Firefox Yes IE No Opera ? Safari ? WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android Yes
contentType Chrome 43 Edge 17 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 43 Chrome Android 43 Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 4.0
cookie Chrome 1 Edge 12 Firefox 1
1
Prior to Firefox 68, cookie was available only on HTML documents; it is now available on all documents, such as XML and SVG.
IE 4 Opera 3 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4
4
Prior to Firefox 68, cookie was available only on HTML documents; it is now available on all documents, such as XML and SVG.
Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
copy event Chrome 58 Edge ≤18 Firefox Yes IE No Opera 45 Safari Yes WebView Android 58 Chrome Android 58 Firefox Android Yes Opera Android 43 Safari iOS ? Samsung Internet Android 7.0
createAttribute Chrome 1 Edge 12 Firefox 44
44
不支持 4 — 44
The parameter was not converted to its lowercase variant.
IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 44
44
不支持 4 — 44
The parameter was not converted to its lowercase variant.
Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
createAttributeNS Chrome 1 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
createCDATASection Chrome 1 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
createComment Chrome 1 Edge 12 Firefox Yes IE Yes Opera Yes Safari 7 WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
createDocumentFragment Chrome 1 Edge 12 Firefox Yes IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
createElement Chrome 1 Edge 12 Firefox 1
1
Doesn't conform to the DOM spec for XUL and XHTML documents: localName and namespaceURI are not set to null on the created element.
IE 5 Opera 6 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
createElementNS Chrome 1 Edge 12 Firefox Yes
Yes
Doesn't conform to the DOM spec for XUL and XHTML documents: localName and namespaceURI are not set to null on the created element.
IE 9 Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
createEntityReference 弃用 非标 Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
createEvent Chrome 1 Edge 12 Firefox 1
1
From version 67, creating touch events using this method is no longer supported.
IE 9 Opera 7 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
createExpression Chrome 1 Edge 12 Firefox Yes IE ? Opera ? Safari ? WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android Yes
createNodeIterator Chrome 1 Edge 12 Firefox 3.5 IE 9 Opera 9 Safari 3 WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
createNSResolver Chrome 1 Edge 12 Firefox Yes IE ? Opera ? Safari ? WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android Yes
createProcessingInstruction Chrome 1 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
createRange Chrome 1 Edge 12 Firefox Yes IE 9 Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
createTextNode Chrome 1 Edge 12 Firefox 1 IE 5 Opera 7 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
createTouch 弃用 非标 Chrome 22 — 66
不支持 22 — 66
59
All parameters optional
Edge 79
79
All parameters optional
Firefox 18 — 67 IE No Opera ? — 53 Safari No WebView Android ? — 66
不支持 ? — 66
59
All parameters optional
Chrome Android 25 — 66
不支持 25 — 66
59
All parameters optional
Firefox Android 6 Opera Android ? — 47 Safari iOS Yes Samsung Internet Android 1.5 — 9.0
不支持 1.5 — 9.0
7.0
All parameters optional
createTouchList 弃用 非标 Chrome 22 — 69 Edge No Firefox 18 — 67 IE No Opera ? — 56 Safari No WebView Android ? — 69 Chrome Android 25 — 69 Firefox Android 6 Opera Android ? — 48 Safari iOS Yes Samsung Internet Android 1.5 — 10.0
createTreeWalker Chrome 1 Edge 12 Firefox 2 IE 9 Opera 9 Safari 3 WebView Android Yes Chrome Android Yes Firefox Android 4 Opera Android 10.1 Safari iOS 3 Samsung Internet Android Yes
currentScript Chrome 29 Edge 12 Firefox 4 IE No Opera 16 Safari 8 WebView Android Yes Chrome Android 29 Firefox Android Yes Opera Android Yes Safari iOS 8 Samsung Internet Android 2.0
cut event Chrome 58 Edge ≤18 Firefox Yes IE No Opera 45 Safari Yes WebView Android 58 Chrome Android 58 Firefox Android Yes Opera Android 43 Safari iOS ? Samsung Internet Android 7.0
defaultView Chrome 1 Edge 12 Firefox Yes IE 9 Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
designMode Chrome 1 Edge 12 Firefox 1 IE 4 Opera 9 Safari 1.2 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
dir Chrome 45
45
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes
Yes
Incorrect behavior before Firefox 23.
IE Yes Opera Yes Safari Yes WebView Android 45
45
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Chrome Android 45
45
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Firefox Android Yes
Yes
Incorrect behavior before Firefox 23.
Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
5.0
Before Samsung Internet 9.0, this property was accessed through the HTMLDocument 别名。
doctype Chrome 1 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
documentElement Chrome 1 Edge 12 Firefox 1 IE 5 Opera 7 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
documentURI Chrome 1 Edge 17 Firefox Yes IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
documentURIObject 非标 Chrome No Edge No Firefox ? — 57
不支持 ? — 57
Available only to legacy extensions .
IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android ? — 57
不支持 ? — 57
Available only to legacy extensions .
Opera Android No Safari iOS No Samsung Internet Android No
domain Chrome 1 Edge 12 Firefox Yes
Yes
From Firefox 62, if the domain cannot be identified, domain returns an empty string instead of null 。见 bug 819475 .
IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes
Yes
From Firefox 62, if the domain cannot be identified, domain returns an empty string instead of null 。见 bug 819475 .
Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
domConfig 弃用 非标 Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
drag event Chrome 4 Edge 12 Firefox 部分支持 3.5
部分支持 3.5
Firefox doesn't set the mouse coordinates during the drag event. See bug 505521 .
IE 10 Opera 12 Safari 3.1 WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS 11 Samsung Internet Android No
dragend event Chrome 4
4
Prior to Chrome 72, the dragend event was not dispatched if an iframe (not necessarily the source target) is involved in a DOM operation. See issue 737691 了解更多细节。
Edge 12 Firefox 部分支持 3.5
部分支持 3.5
Firefox doesn't set the mouse coordinates during the drag event. See bug 505521 .
In Firefox, dragend is not dispatched if the source node is moved or removed during the drag (e.g. on drop or dragover )。见 bug 460801 了解细节。
IE 10 Opera 12 Safari 3.1 WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS 11 Samsung Internet Android No
dragenter event Chrome 4 Edge 12 Firefox 3.5
3.5
In Firefox, the dragenter event is fired twice when the dropzone is parent of draggable or draggable itself. See bug 804036 了解细节。
IE 10 Opera 12 Safari 3.1 WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS 11 Samsung Internet Android No
dragexit event Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
dragleave event Chrome 4 Edge 12 Firefox 3.5 IE 10 Opera 12 Safari 3.1 WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS 11 Samsung Internet Android No
dragover event Chrome 4 Edge 12 Firefox 3.5 IE 10 Opera 12 Safari 3.1 WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS 11 Samsung Internet Android No
dragstart event Chrome 4 Edge 12 Firefox 3.5 IE 10 Opera 12 Safari 3.1 WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS 11 Samsung Internet Android No
drop event Chrome 4 Edge 12 Firefox 3.5 IE 10 Opera 12 Safari 3.1 WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS 11 Samsung Internet Android No
嵌入 Chrome 45
45
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 45
45
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Chrome Android 45
45
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
5.0
Before Samsung Internet 9.0, this property was accessed through the HTMLDocument 别名。
enableStyleSheetsForSet 弃用 非标 Chrome No Edge No Firefox Yes IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android No
evaluate Chrome 1 Edge 12 Firefox 1.5 IE No Opera 9 Safari 5 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 4.2 Samsung Internet Android 1.0
execCommand 弃用 非标 Chrome 1 Edge 12 Firefox 1 IE 4 Opera 9 Safari 1.3 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
execCommandShowHelp 弃用 非标 Chrome No Edge 12 — 79 Firefox ? — 14
不支持 ? — 14
This method never did anything and always threw an exception.
IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android ? — 14
不支持 ? — 14
This method never did anything and always threw an exception.
Opera Android No Safari iOS No Samsung Internet Android No
exitFullscreen Chrome 45
45
Yes Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge 12 Firefox 64
64
不支持 49 — 65 Disabled
Disabled From version 49 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 9 — 65 Alternate Name
Alternate Name Uses the non-standard name: mozCancelFullScreen
IE 11 Alternate Name
11 Alternate Name
Alternate Name Uses the non-standard name: msExitFullscreen
Opera 15 Prefixed
15 Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari 5.1 Prefixed
5.1 Prefixed
Prefixed Implemented with the vendor prefix: webkit
WebView Android 45
45
Yes Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android 45
45
Yes Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android 64
64
不支持 49 — 65 Disabled
Disabled From version 49 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 9 — 65 Alternate Name
Alternate Name Uses the non-standard name: mozCancelFullScreen
Opera Android Yes Safari iOS No Samsung Internet Android 5.0
5.0
Yes Prefixed
Prefixed Implemented with the vendor prefix: webkit
exitPointerLock Chrome 45
45
22 Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge 13 Firefox 50
50
Yes Prefixed
Prefixed Implemented with the vendor prefix: moz
IE ? Opera Yes Safari Yes WebView Android 45
45
Yes Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android 45
45
Yes Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android 50
50
Yes Prefixed
Prefixed Implemented with the vendor prefix: moz
Opera Android Yes Safari iOS ? Samsung Internet Android 5.0
5.0
1.5 Prefixed
Prefixed Implemented with the vendor prefix: webkit
featurePolicy Chrome 74
74
Chrome Platform Status incorrectly describes this variable as document.policy . It was renamed in bug 917057 before being shipped in bug 703703 .
不支持 73 — 74 Disabled
Disabled From version 73 until version 74 (exclusive): this feature is behind the #enable-experimental-productivity-features preference (needs to be set to 启用 ). To change preferences in Chrome, visit chrome://flags.
不支持 69 — 73 Alternate Name Disabled
Alternate Name Uses the non-standard name: policy
Disabled ). To change preferences in Chrome, visit
Edge 79
79
Chrome Platform Status incorrectly describes this variable as document.policy . It was renamed in bug 917057 before being shipped in bug 703703 .
Firefox 69 Disabled
69 Disabled
Disabled From version 69: this feature is behind the dom.security.featurePolicy.webidl.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 65 — 69 Alternate Name Disabled
Alternate Name Uses the non-standard name: policy
Disabled ). To change preferences in Firefox, visit about:config.
IE No Opera 62
62
不支持 60 — 62 Disabled
Disabled From version 60 until version 62 (exclusive): this feature is behind the #enable-experimental-productivity-features preference (needs to be set to 启用 ).
不支持 56 — 60 Alternate Name Disabled
Alternate Name Uses the non-standard name: policy
Disabled From version 56 until version 60 (exclusive): this feature is behind the #enable-experimental-productivity-features preference (needs to be set to 启用 ).
Safari No WebView Android 74
74
Chrome Platform Status incorrectly describes this variable as document.policy . It was renamed in bug 917057 before being shipped in bug 703703 .
Chrome Android 74
74
Chrome Platform Status incorrectly describes this variable as document.policy . It was renamed in bug 917057 before being shipped in bug 703703 .
不支持 73 — 74 Disabled
Disabled From version 73 until version 74 (exclusive): this feature is behind the #enable-experimental-productivity-features preference (needs to be set to 启用 ). To change preferences in Chrome, visit chrome://flags.
不支持 69 — 73 Alternate Name Disabled
Alternate Name Uses the non-standard name: policy
Disabled ). To change preferences in Chrome, visit
Firefox Android 65 Alternate Name Disabled
65 Alternate Name Disabled
Alternate Name Uses the non-standard name: policy
Disabled ). To change preferences in Firefox, visit about:config.
Opera Android 48 Alternate Name Disabled
48 Alternate Name Disabled
Alternate Name Uses the non-standard name: policy
Disabled From version 48: this feature is behind the #enable-experimental-productivity-features preference (needs to be set to 启用 ).
Safari iOS No Samsung Internet Android 11.0
fgColor 弃用 非标 Chrome 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Chrome Android 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 9.0
9.0
Before Samsung Internet 9.0, this property was accessed through the HTMLDocument 别名。
fileSize 弃用 非标 Chrome No Edge No Firefox No IE ? — 11 Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
fonts Chrome 60 Edge 79 Firefox 41
41
不支持 35 — 41 Disabled
Disabled ). To change preferences in Firefox, visit
IE No Opera 47 Safari 10 WebView Android 60 Chrome Android 60 Firefox Android Yes Opera Android 44 Safari iOS 10 Samsung Internet Android 5.0
forms Chrome 1 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
fullscreen 弃用 Chrome 71
71
15 Alternate Name
Alternate Name Uses the non-standard name: webkitIsFullscreen
Edge ≤79
≤79
≤79 Alternate Name
Alternate Name Uses the non-standard name: webkitIsFullscreen
Firefox 64
64
不支持 49 — 65 Disabled
Disabled From version 49 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 9 — 65 Alternate Name
Alternate Name Uses the non-standard name: mozFullScreen
IE No Opera 58
58
15 Alternate Name
Alternate Name Uses the non-standard name: webkitIsFullscreen
Safari 6 Alternate Name
6 Alternate Name
Alternate Name Uses the non-standard name: webkitIsFullScreen
WebView Android 71
71
≤37 Alternate Name
Alternate Name Uses the non-standard name: webkitIsFullscreen
Chrome Android 71
71
18 Alternate Name
Alternate Name Uses the non-standard name: webkitIsFullscreen
Firefox Android 64
64
不支持 49 — 65 Disabled
Disabled From version 49 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 9 — 65 Alternate Name
Alternate Name Uses the non-standard name: mozFullScreen
Opera Android 50
50
14 Alternate Name
Alternate Name Uses the non-standard name: webkitIsFullscreen
Safari iOS 6 Alternate Name
6 Alternate Name
Alternate Name Uses the non-standard name: webkitIsFullScreen
Samsung Internet Android 10.0
10.0
1.0 Alternate Name
Alternate Name Uses the non-standard name: webkitIsFullscreen
fullscreenchange event Chrome 45 Edge 12 Firefox 64
64
不支持 47 — 64 Disabled
Disabled From version 47 until version 64 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 10 — 64 Alternate Name
Alternate Name Uses the non-standard name: mozfullscreenchange
IE 11 Alternate Name
11 Alternate Name
Alternate Name Uses the non-standard name: MSFullscreenChange
Opera 32 Safari ? WebView Android 45 Chrome Android 45 Firefox Android 64
64
不支持 47 — 64 Disabled
Disabled From version 47 until version 64 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 10 — 64 Alternate Name
Alternate Name Uses the non-standard name: mozfullscreenchange
Opera Android 32 Safari iOS ? Samsung Internet Android 5.0
fullscreenEnabled Chrome 45
45
Yes Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge 12 Firefox 64
64
不支持 47 — 65 Disabled
Disabled From version 47 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 10 — 65 Alternate Name
Alternate Name Uses the non-standard name: mozFullScreenEnabled
IE 11 Alternate Name
11 Alternate Name
Alternate Name Uses the non-standard name: msFullScreenEnabled
Opera Yes Safari ? WebView Android 45
45
Yes Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android 45
45
Yes Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android 64
64
不支持 47 — 65 Disabled
Disabled From version 47 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 10 — 65 Alternate Name
Alternate Name Uses the non-standard name: mozFullScreenEnabled
Opera Android Yes Safari iOS ? Samsung Internet Android 5.0
5.0
Yes Prefixed
Prefixed Implemented with the vendor prefix: webkit
fullscreenerror event Chrome 45 Edge 12 Firefox 64
64
不支持 47 — 64 Disabled
Disabled From version 47 until version 64 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 10 — 64 Alternate Name
Alternate Name Uses the non-standard name: mozfullscreenerror
IE 11 Alternate Name
11 Alternate Name
Alternate Name Uses the non-standard name: MSFullscreenError
Opera 32 Safari ? WebView Android 45 Chrome Android 45 Firefox Android 64
64
不支持 47 — 64 Disabled
Disabled From version 47 until version 64 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 10 — 65 Alternate Name
Alternate Name Uses the non-standard name: mozfullscreenerror
Opera Android 32 Safari iOS ? Samsung Internet Android 5.0
getAnimations Chrome 83 Disabled
83 Disabled
Disabled From version 83: this feature is behind the #enable-experimental-web-platform-features preference. To change preferences in Chrome, visit chrome://flags.
不支持 67 — 83 Disabled
Implements an older version of the specification and not supported on ShadowRoot ,见 Chromium bug 828585 .
Disabled From version 67 until version 83 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference. To change preferences in Chrome, visit chrome://flags.
不支持 61 — 67 Disabled
Implements an older version of the specification, does not automatically flush pending style changes and not supported on ShadowRoot , see Chromium bugs 828424 and 828585 .
Disabled From version 61 until version 67 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference. To change preferences in Chrome, visit chrome://flags.
Edge 83 Disabled
83 Disabled
Disabled From version 83: this feature is behind the #enable-experimental-web-platform-features preference.
不支持 79 — 83 Disabled
Implements an older version of the specification and not supported on ShadowRoot ,见 Chromium bug 828585 .
Disabled From version 79 until version 83 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference.
Firefox 75
75
不支持 72 — 75 Disabled
Disabled From version 72 until version 75 (exclusive): this feature is behind the dom.animations-api.getAnimations.enabled preference. To change preferences in Firefox, visit about:config.
不支持 63 — 72 Disabled
Not supported on ShadowRoot .
Disabled From version 63 until version 72 (exclusive): this feature is behind the dom.animations-api.getAnimations.enabled preference. To change preferences in Firefox, visit about:config.
不支持 47 — 63 Disabled
Not supported on ShadowRoot .
Disabled From version 47 until version 63 (exclusive): this feature is behind the dom.animations-api.core.enabled preference. To change preferences in Firefox, visit about:config.
不支持 46 — 47 Disabled
Does not return any animations on pseudo-elements and is not supported on ShadowRoot .
Disabled From version 46 until version 47 (exclusive): this feature is behind the dom.animations-api.core.enabled preference. To change preferences in Firefox, visit about:config.
IE No Opera 69 Disabled
69 Disabled
Disabled From version 69: this feature is behind the #enable-experimental-web-platform-features preference.
不支持 54 — 69 Disabled
Implements an older version of the specification and not supported on ShadowRoot ,见 Chromium bug 828585 .
Disabled From version 54 until version 69 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference.
不支持 48 — 54 Disabled
Implements an older version of the specification, does not automatically flush pending style changes and not supported on ShadowRoot , see Chromium bugs 828424 and 828585 .
Disabled From version 48 until version 54 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference.
Safari 14
14
部分支持 13.1
Implements an older version of the specification and not supported on ShadowRoot , see Webkit bugs 179536 and 202192 .
部分支持 Partial Disabled
Implements an older version of the specification and not supported on ShadowRoot , see Webkit bugs 179536 and 202192 .
Disabled This feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
WebView Android No
不支持 No
Currently Chrome Canary only
Chrome Android 83 Disabled
83 Disabled
Disabled From version 83: this feature is behind the #enable-experimental-web-platform-features preference. To change preferences in Chrome, visit chrome://flags.
不支持 67 — 83 Disabled
Implements an older version of the specification and not supported on ShadowRoot ,见 Chromium bug 828585 .
Disabled From version 67 until version 83 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference. To change preferences in Chrome, visit chrome://flags.
不支持 61 — 67 Disabled
Implements an older version of the specification, does not automatically flush pending style changes and not supported on ShadowRoot , see Chromium bugs 828424 and 828585 .
Disabled From version 61 until version 67 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference. To change preferences in Chrome, visit chrome://flags.
Firefox Android 部分支持 63 Disabled
部分支持 63 Disabled
Not supported on ShadowRoot .
Disabled From version 63: this feature is behind the dom.animations-api.getAnimations.enabled preference. To change preferences in Firefox, visit about:config.
不支持 47 — 63 Disabled
Not supported on ShadowRoot .
Disabled From version 47 until version 63 (exclusive): this feature is behind the dom.animations-api.core.enabled preference. To change preferences in Firefox, visit about:config.
不支持 46 — 47 Disabled
Does not return any animations on pseudo-elements and is not supported on ShadowRoot .
Disabled From version 46 until version 47 (exclusive): this feature is behind the dom.animations-api.core.enabled preference. To change preferences in Firefox, visit about:config.
Opera Android 部分支持 48 Disabled
部分支持 48 Disabled
Implements an older version of the specification and not supported on ShadowRoot ,见 Chromium bug 828585 .
Disabled From version 48: this feature is behind the #enable-experimental-web-platform-features preference.
不支持 45 — 48 Disabled
Implements an older version of the specification, does not automatically flush pending style changes and not supported on ShadowRoot , see Chromium bugs 828424 and 828585 .
Disabled From version 45 until version 48 (exclusive): this feature is behind the #enable-experimental-web-platform-features preference.
Safari iOS 14
14
部分支持 13.4
Implements an older version of the specification and not supported on ShadowRoot , see Webkit bugs 179536 and 202192 .
部分支持 Partial Disabled
Implements an older version of the specification and not supported on ShadowRoot , see Webkit bugs 179536 and 202192 .
Disabled This feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
Samsung Internet Android No
getBoxObjectFor 弃用 非标 Chrome No Edge No Firefox ? — ? IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
getElementById Chrome 1 Edge 12 Firefox 1 IE 5.5 Opera 7 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
getElementsByClassName Chrome 1 Edge 12 Firefox 4 IE 9 Opera 9.5 Safari 3.1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 2 Samsung Internet Android 1.0
getElementsByName Chrome 1 Edge 12
12
Before Edge 79, this method returns an HTMLCollection , not a NodeList .
Firefox 1 IE 5
5
返回 HTMLCollection , not a NodeList
Opera 5 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
getElementsByTagName Chrome 1 Edge 12 Firefox 1 IE 5 Opera 5.1 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
getElementsByTagNameNS Chrome 1 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
gotpointercapture event Chrome 57 Edge ≤79 Firefox 59 IE ? Opera 44 Safari ? WebView Android 57 Chrome Android 57 Firefox Android No Opera Android 43 Safari iOS ? Samsung Internet Android 7.0
hasFocus Chrome 1 Edge 12 Firefox 3 IE 6 Opera 15 Safari 4 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 14 Safari iOS 3.2 Samsung Internet Android 1.0
hasStorageAccess 非标 Chrome No Edge No Firefox 65 IE No Opera No Safari 11.1 WebView Android No Chrome Android No Firefox Android 65 Opera Android No Safari iOS 11.3 Samsung Internet Android No
head Chrome 4 Edge 12 Firefox 4 IE 9 Opera 11 Safari 5 WebView Android Yes Chrome Android Yes Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
height 弃用 非标 Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
hidden Chrome 33
33
13 Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge 12 Firefox 18
18
Since Firefox 56 it also returns true on Mac when the window is completely hidden by another non-translucent application.
不支持 10 — 52 Prefixed
Prefixed Implemented with the vendor prefix: moz
IE 10 Opera 12.1 Safari 7 WebView Android Yes Chrome Android 33
33
Yes Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android 18
18
Since Firefox 56 it also returns true on Mac when the window is completely hidden by another non-translucent application.
不支持 10 — 52 Prefixed
Prefixed Implemented with the vendor prefix: moz
Opera Android 12.1 Safari iOS 7 Samsung Internet Android 2.0
2.0
1.0 Prefixed
Prefixed Implemented with the vendor prefix: webkit
图像 Chrome 1 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
实现 Chrome 1 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
importNode Chrome 1 Edge 12 Firefox 4 IE 9 Opera 9 Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 4 Opera Android 10.1 Safari iOS Yes Samsung Internet Android Yes
keydown event Chrome 1 Edge 12 Firefox 14 IE 9 Opera 11.6 Safari 2 WebView Android 1 Chrome Android 18 Firefox Android 14 Opera Android 12 Safari iOS 1 Samsung Internet Android 1.0
keypress event 弃用 Chrome 1
1
Chrome does not fire the keypress event for known keyboard shortcuts . Which keyboard shortcuts are known depends on the user's system. Use the keydown event to implement keyboard shortcuts.
Edge 12 Firefox 14
14
As of Firefox 65, the keypress event is no longer fired for non-printable keys , except for the Enter key, and the Shift + Enter and Ctrl + Enter key combinations (these were kept for cross-browser compatibility purposes).
IE 9 Opera 11.6 Safari 2 WebView Android 1
1
Chrome does not fire the keypress event for known keyboard shortcuts . Which keyboard shortcuts are known depends on the user's system. Use the keydown event to implement keyboard shortcuts.
Chrome Android 18
18
Chrome does not fire the keypress event for known keyboard shortcuts . Which keyboard shortcuts are known depends on the user's system. Use the keydown event to implement keyboard shortcuts.
Firefox Android 14
14
As of Firefox 65, the keypress event is no longer fired for non-printable keys , except for the Enter key, and the Shift + Enter and Ctrl + Enter key combinations (these were kept for cross-browser compatibility purposes).
Opera Android 12 Safari iOS 1 Samsung Internet Android 1.0
1.0
Samsung Internet does not fire the keypress event for known keyboard shortcuts . Which keyboard shortcuts are known depends on the user's system. Use the keydown event to implement keyboard shortcuts.
keyup event Chrome 1 Edge 12 Firefox 14 IE 9 Opera 11.6 Safari 2 WebView Android 1 Chrome Android 18 Firefox Android 14 Opera Android 12 Safari iOS 1 Samsung Internet Android 1.0
lastModified Chrome 1 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
lastStyleSheetSet 弃用 非标 Chrome No Edge No Firefox Yes IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android No
linkColor 弃用 非标 Chrome 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Chrome Android 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 9.0
9.0
Before Samsung Internet 9.0, this property was accessed through the HTMLDocument 别名。
链接 Chrome 1 Edge 12 Firefox Yes IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
loadOverlay 弃用 非标 Chrome No Edge No Firefox ? — 61
不支持 ? — 61
Available only to XUL documents .
bug 1449791
不支持 ? — 61
Available only to XUL documents .
bug 1449791
IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
location Chrome 1 Edge 12 Firefox 1 IE 4 Opera 3 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
lostpointercapture event Chrome 57 Edge ≤79 Firefox 59 IE ? Opera 44 Safari ? WebView Android 57 Chrome Android 57 Firefox Android No Opera Android 43 Safari iOS ? Samsung Internet Android 7.0
mozSetImageElement 非标 Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
mozSyntheticDocument 非标 Chrome No Edge No Firefox No IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
normalizeDocument 弃用 非标 Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
onafterscriptexecute 非标 Chrome No Edge No Firefox Yes IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android No
onbeforescriptexecute 非标 Chrome No Edge No Firefox Yes IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android No
oncopy 非标 Chrome Yes Edge 17 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
oncut 非标 Chrome Yes Edge 17 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
onfreeze Chrome 68 Edge 79 Firefox No IE No Opera 55 Safari No WebView Android 68 Chrome Android 68 Firefox Android No Opera Android 48 Safari iOS No Samsung Internet Android 10.0
onfullscreenchange Chrome 45 Edge 12 Firefox 64
64
不支持 47 — 65 Disabled
Disabled From version 47 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 10 — 65 Alternate Name
Alternate Name Uses the non-standard name: onmozfullscreenchange
IE 11 Alternate Name
11 Alternate Name
Alternate Name Uses the non-standard name: onMSFullscreenChange
Opera Yes Safari ? WebView Android 45 Chrome Android 45 Firefox Android 64
64
不支持 47 — 65 Disabled
Disabled From version 47 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 10 — 65 Alternate Name
Alternate Name Uses the non-standard name: onmozfullscreenchange
Opera Android Yes Safari iOS ? Samsung Internet Android 5.0
onfullscreenerror Chrome 45 Edge 12 Firefox 64
64
不支持 47 — 65 Disabled
Disabled From version 47 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 10 — 65 Alternate Name
Alternate Name Uses the non-standard name: onmozfullscreenerror
IE 11 Alternate Name
11 Alternate Name
Alternate Name Uses the non-standard name: onMSFullscreenError
Opera Yes Safari ? WebView Android 45 Chrome Android 45 Firefox Android 64
64
不支持 47 — 65 Disabled
Disabled From version 47 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 10 — 65 Alternate Name
Alternate Name Uses the non-standard name: onmozfullscreenerror
Opera Android Yes Safari iOS ? Samsung Internet Android 5.0
onpaste 非标 Chrome Yes Edge 17 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
onpointerlockchange Chrome Yes Edge 13 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS ? Samsung Internet Android Yes
onpointerlockerror Chrome Yes Edge 13 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS ? Samsung Internet Android Yes
onreadystatechange Chrome Yes Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
onresume Chrome 68 Edge 79 Firefox No IE No Opera 55 Safari No WebView Android 68 Chrome Android 68 Firefox Android No Opera Android 48 Safari iOS No Samsung Internet Android 10.0
onvisibilitychange Chrome 33
33
13 Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge 18 Firefox 56 IE 10 Opera 12.1
12.1
Doesn't fire the visibilitychange event when the browser window is minimized, nor when hidden 被设为 true。
Safari 7 WebView Android 4.4.3 Chrome Android 33 Firefox Android 56 Opera Android 12.1
12.1
Doesn't fire the visibilitychange event when the browser window is minimized, nor when hidden 被设为 true。
Safari iOS 7 Samsung Internet Android 2.0
open Chrome 45
45
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE Yes Opera Yes Safari Yes WebView Android 45
45
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Chrome Android 45
45
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
5.0
Before Samsung Internet 9.0, this method was accessed through the HTMLDocument 别名。
origin 弃用 非标 Chrome 41 — 71 Edge 12 — 79 Firefox No IE Yes Opera 28 — 58 Safari Yes WebView Android 41 — 71 Chrome Android 41 — 71 Firefox Android No Opera Android 28 — 50 Safari iOS Yes Samsung Internet Android 4.0 — 10.0
paste event Chrome 58 Edge 12 Firefox Yes IE 11 Opera 45 Safari Yes WebView Android 58 Chrome Android 58 Firefox Android Yes Opera Android 43 Safari iOS ? Samsung Internet Android 7.0
plugins Chrome 45
45
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 45
45
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Chrome Android 45
45
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
5.0
Before Samsung Internet 9.0, this property was accessed through the HTMLDocument 别名。
pointercancel event Chrome 55 Edge 12
12
不支持 12 — 79 Alternate Name
Alternate Name Uses the non-standard name: mspointercancel
Firefox 59
59
Disabled ). To change preferences in Firefox, visit
IE 11
11
10 Alternate Name
Alternate Name Uses the non-standard name: mspointercancel
Opera ? Safari No WebView Android 55 Chrome Android 55 Firefox Android 29 Opera Android ? Safari iOS No Samsung Internet Android 6.0
pointerdown event Chrome 55 Edge 12
12
不支持 12 — 79 Alternate Name
Alternate Name Uses the non-standard name: mspointerdown
Firefox 59
59
Disabled ). To change preferences in Firefox, visit
IE 11
11
10 Alternate Name
Alternate Name Uses the non-standard name: mspointerdown
Opera ? Safari No WebView Android 55 Chrome Android 55 Firefox Android 29 Opera Android ? Safari iOS No Samsung Internet Android 6.0
pointerenter event Chrome 55 Edge 12
12
不支持 12 — 79 Alternate Name
Alternate Name Uses the non-standard name: mspointerenter
Firefox 59
59
Disabled ). To change preferences in Firefox, visit
IE 11
11
10 Alternate Name
Alternate Name Uses the non-standard name: mspointerenter
Opera ? Safari No WebView Android 55 Chrome Android 55 Firefox Android 29 Opera Android ? Safari iOS No Samsung Internet Android 6.0
pointerleave event Chrome 55 Edge 12
12
不支持 12 — 79 Alternate Name
Alternate Name Uses the non-standard name: mspointerleave
Firefox 59
59
Disabled ). To change preferences in Firefox, visit
IE 11
11
10 Alternate Name
Alternate Name Uses the non-standard name: mspointerleave
Opera ? Safari No WebView Android 55 Chrome Android 55 Firefox Android 29 Opera Android ? Safari iOS No Samsung Internet Android 6.0
pointerlockchange event Chrome 45
45
不支持 22 — 45 Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge ≤79 Firefox ? IE ? Opera ? Safari ? WebView Android 45
45
不支持 ? — 45 Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android 45
45
不支持 25 — 45 Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android 5.0
5.0
不支持 1.5 — 5.0 Prefixed
Prefixed Implemented with the vendor prefix: webkit
pointerlockerror event Chrome 45
45
不支持 22 — 45 Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge ≤79 Firefox ? IE ? Opera ? Safari ? WebView Android 45
45
不支持 ? — 45 Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android 45
45
不支持 25 — 45 Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android 5.0
5.0
不支持 1.5 — 5.0 Prefixed
Prefixed Implemented with the vendor prefix: webkit
pointermove event Chrome 55 Edge 12
12
不支持 12 — 79 Alternate Name
Alternate Name Uses the non-standard name: mspointermove
Firefox 59
59
Disabled ). To change preferences in Firefox, visit
IE 11
11
10 Alternate Name
Alternate Name Uses the non-standard name: mspointermove
Opera ? Safari No WebView Android 55 Chrome Android 55 Firefox Android 29 Opera Android ? Safari iOS No Samsung Internet Android 6.0
pointerout event Chrome 55 Edge 12
12
不支持 12 — 79 Alternate Name
Alternate Name Uses the non-standard name: mspointerout
Firefox 59
59
Disabled ). To change preferences in Firefox, visit
IE 11
11
10 Alternate Name
Alternate Name Uses the non-standard name: mspointerout
Opera ? Safari No WebView Android 55 Chrome Android 55 Firefox Android 29 Opera Android ? Safari iOS No Samsung Internet Android 6.0
pointerover event Chrome 55 Edge 12
12
不支持 12 — 79 Alternate Name
Alternate Name Uses the non-standard name: mspointerover
Firefox 59
59
Disabled ). To change preferences in Firefox, visit
IE 11
11
10 Alternate Name
Alternate Name Uses the non-standard name: mspointerover
Opera ? Safari No WebView Android 55 Chrome Android 55 Firefox Android 29 Opera Android ? Safari iOS No Samsung Internet Android 6.0
pointerup event Chrome 55 Edge 12
12
不支持 12 — 79 Alternate Name
Alternate Name Uses the non-standard name: mspointerup
Firefox 59
59
Disabled ). To change preferences in Firefox, visit
IE 11
11
10 Alternate Name
Alternate Name Uses the non-standard name: mspointerup
Opera ? Safari No WebView Android 55 Chrome Android 55 Firefox Android 29 Opera Android ? Safari iOS No Samsung Internet Android 6.0
popupNode 弃用 非标 Chrome No Edge No Firefox Yes
Yes
Available only to XUL documents .
IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
preferredStyleSheetSet 弃用 非标 Chrome 1 Edge ≤79 Firefox Yes IE ? Opera ? Safari ? WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android Yes
queryCommandEnabled 弃用 非标 Chrome 1 Edge 12 Firefox 41
41
不支持 9 — 41
queryCommandEnabled 采用自变量 cut , copy or paste would throw errors unless the script had special privileges.
IE 4 Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 41
41
不支持 9 — 41
queryCommandEnabled 采用自变量 cut , copy or paste would throw errors unless the script had special privileges.
Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
queryCommandIndeterm Chrome 1 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
queryCommandState 弃用 非标 Chrome 1 Edge 12 Firefox Yes IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
queryCommandSupported 弃用 非标 Chrome 1 Edge 12 Firefox 41
41
不支持 9 — 41
paste argument incorrectly returned true when the paste feature was available but the calling script had insufficient privileges to actually perform the action.
IE 4 Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 41
41
不支持 9 — 41
paste argument incorrectly returned true when the paste feature was available but the calling script had insufficient privileges to actually perform the action.
Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
queryCommandText 弃用 非标 Chrome No Edge 12 — 79 Firefox ? — 14
不支持 ? — 14
This method never did anything and always threw an exception.
IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android ? — 14
不支持 ? — 14
This method never did anything and always threw an exception.
Opera Android No Safari iOS No Samsung Internet Android No
queryCommandValue Chrome 1 Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
querySelector Chrome 1 Edge 12 Firefox 3.5 IE 8 Opera 10 Safari 3.2 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 3 Samsung Internet Android 1.0
querySelectorAll Chrome 1 Edge 12 Firefox 3.5 IE 8 Opera 10 Safari 3.2 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 3 Samsung Internet Android 1.0
readyState Chrome 1 Edge 12 Firefox 4 IE 11
11
不支持 9 — 11
Internet Explorer 9 and 10 have bugs where the 'interactive' state can be fired too early before the document has finished parsing.
不支持 8 — 9
Only supports 'complete'.
Opera 11
11
Opera Presto fires 'complete' late after the 'load' event (in an incorrect order as per HTML5 standard specification).
Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 11
11
Opera Presto fires 'complete' late after the 'load' event (in an incorrect order as per HTML5 standard specification).
Safari iOS 1 Samsung Internet Android 1.0
readystatechange event Chrome Yes Edge 12 Firefox Yes IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
referrer Chrome 1 Edge 12 Firefox 1 IE 4 Opera 3 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
registerElement 弃用 非标 Chrome 35 — 80 Edge 79 — 80 Firefox 31 — 59 Disabled
不支持 31 — 59 Disabled
Disabled From version 31 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true ) 和 preference (needs to be set to ). To change preferences in Firefox, visit about:config.
IE No Opera 25 — 67 Safari No WebView Android 37 — 80 Chrome Android 35 — 80 Firefox Android 31 — 59 Disabled
不支持 31 — 59 Disabled
Disabled From version 31 until version 59 (exclusive): this feature is behind the dom.webcomponents.enabled preference (needs to be set to true ) 和 preference (needs to be set to ). To change preferences in Firefox, visit about:config.
Opera Android 25 Safari iOS No Samsung Internet Android 3.0
releaseCapture 非标 Chrome No Edge No Firefox Yes IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android No
releaseEvents 弃用 非标 Chrome 64
64
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 64
64
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Chrome Android 64
64
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 9.0
9.0
Before Samsung Internet 9.0, this method was accessed through the HTMLDocument 别名。
requestStorageAccess 非标 Chrome No Edge No Firefox 65 IE No Opera No Safari 11.1 WebView Android No Chrome Android No Firefox Android 65 Opera Android No Safari iOS 11.3 Samsung Internet Android No
routeEvent 弃用 非标 Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
脚本 Chrome Yes Edge 12 Firefox 9 IE 4 Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 9 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
scroll event Chrome 1 Edge 12 Firefox 6 IE 9 Opera 11.6 Safari 2 WebView Android 1 Chrome Android 18 Firefox Android 6 Opera Android 12 Safari iOS 1 Samsung Internet Android 1.0
scrollingElement Chrome 44 Edge 12 Firefox 48
48
不支持 47 — 48 Disabled
Disabled From version 47 until version 48 (exclusive): this feature is behind the dom.document.scrollingElement.enabled preference. To change preferences in Firefox, visit about:config.
IE No Opera 31 Safari 9 WebView Android 44 Chrome Android 44 Firefox Android Yes Opera Android 32 Safari iOS 9 Samsung Internet Android 4.0
selectedStyleSheetSet 弃用 非标 Chrome 1 Edge ≤79 Firefox Yes IE ? Opera ? Safari ? WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android Yes
selectionchange event Chrome Yes Edge 12 Firefox 52
52
Disabled ). To change preferences in Firefox, visit
IE Yes Opera ? Safari 1.3 WebView Android Yes Chrome Android Yes Firefox Android 52
52
Disabled ). To change preferences in Firefox, visit
Opera Android ? Safari iOS Yes Samsung Internet Android Yes
selectstart event Chrome Yes Edge 12 Firefox 52
52
Disabled ). To change preferences in Firefox, visit
IE Yes Opera ? Safari 1.3 WebView Android Yes Chrome Android Yes Firefox Android 52
52
Disabled ). To change preferences in Firefox, visit
Opera Android ? Safari iOS Yes Samsung Internet Android Yes
styleSheetSets 弃用 非标 Chrome No Edge No Firefox Yes IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android Yes Opera Android ? Safari iOS ? Samsung Internet Android No
timeline Chrome No
不支持 No
Currently Chrome Canary only
Edge No Firefox 75 IE Yes Opera No Safari 13.1 WebView Android No Chrome Android No
不支持 No
Currently Chrome Canary only
Firefox Android 63 Disabled
63 Disabled
Disabled From version 63: this feature is behind the dom.animations-api.timelines.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
不支持 32 — 63 Disabled
Disabled ). To change preferences in Firefox, visit
Opera Android No Safari iOS 13.4 Samsung Internet Android No
title Chrome 1 Edge 12 Firefox Yes IE Yes Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
tooltipNode 非标 Chrome No Edge No Firefox Yes
Yes
Available only to XUL documents .
IE No Opera No Safari No WebView Android No Chrome Android No Firefox Android No Opera Android No Safari iOS No Samsung Internet Android No
touchcancel event Chrome 22 Edge 12 Firefox 52 IE No Opera No Safari No WebView Android Yes Chrome Android 25 Firefox Android 6 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.5
touchend event Chrome 22 Edge 12 Firefox 52 IE No Opera No Safari No WebView Android Yes Chrome Android 25 Firefox Android 6 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.5
touchmove event Chrome 22 Edge 12 Firefox 52 IE No Opera No Safari No WebView Android Yes Chrome Android 25 Firefox Android 6 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.5
touchstart event Chrome 22 Edge 12 Firefox 52 IE No Opera No Safari No WebView Android Yes Chrome Android 25 Firefox Android 6 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.5
transitioncancel event Chrome No Edge No Firefox 53 IE ? Opera ? Safari 13.1
13.1
12 Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
WebView Android No Chrome Android No Firefox Android 53 Opera Android ? Safari iOS 13.4
13.4
12 Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
Samsung Internet Android No
transitionend event Chrome No Edge No Firefox 51 IE ? Opera ? Safari Yes WebView Android No Chrome Android No Firefox Android 51 Opera Android ? Safari iOS Yes Samsung Internet Android No
transitionrun event Chrome No Edge No Firefox 53 IE ? Opera ? Safari 13.1
13.1
12 Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
WebView Android No Chrome Android No Firefox Android 53 Opera Android ? Safari iOS 13.4
13.4
12 Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
Samsung Internet Android No
transitionstart event Chrome No Edge No Firefox 53 IE ? Opera ? Safari 13.1
13.1
12 Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
WebView Android No Chrome Android No Firefox Android 53 Opera Android ? Safari iOS 13.4
13.4
12 Disabled
Disabled From version 12: this feature is behind the Web 动画 preference and the CSS Animations via Web Animations preference.
Samsung Internet Android No
undoManager Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
visibilityState Chrome 33
33
13 Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge 12 Firefox 18
18
不支持 10 — 52 Prefixed
Prefixed Implemented with the vendor prefix: moz
IE 10 Opera 12.1
12.1
Doesn't fire the visibilitychange event when the browser window is minimized, nor when hidden 被设为 true。
Safari 7 WebView Android 4.4.3 Chrome Android 33
33
Yes Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android 18
18
不支持 10 — 52 Prefixed
Prefixed Implemented with the vendor prefix: moz
Opera Android 12.1
12.1
Doesn't fire the visibilitychange event when the browser window is minimized, nor when hidden 被设为 true。
Safari iOS 7 Samsung Internet Android 3.0
3.0
1.0 Prefixed
Prefixed Implemented with the vendor prefix: webkit
vlinkColor 弃用 非标 Chrome 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Chrome Android 64
64
Before Chrome 64, this property was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 9.0
9.0
Before Samsung Internet 9.0, this property was accessed through the HTMLDocument 别名。
wasDiscarded Chrome 68 Edge 79 Firefox No IE No Opera 55 Safari No WebView Android 68 Chrome Android 68 Firefox Android No Opera Android 48 Safari iOS No Samsung Internet Android 10.0
wheel event Chrome 61 Edge 12 Firefox Yes IE Yes Opera 48 Safari 6.1 WebView Android 61 Chrome Android 61 Firefox Android Yes Opera Android 45 Safari iOS No Samsung Internet Android 8.0
width 弃用 非标 Chrome No Edge No Firefox No IE ? Opera ? Safari ? WebView Android No Chrome Android No Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android No
write Chrome 1 Edge 12 Firefox 1 IE 4 Opera 3 Safari 1 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
writeln Chrome 45
45
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Edge 12 Firefox Yes IE ? Opera Yes Safari Yes WebView Android 45
45
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Chrome Android 45
45
Before Chrome 64, this method was accessed through the HTMLDocument 别名。
Firefox Android Yes Opera Android Yes Safari iOS Yes Samsung Internet Android 5.0
5.0
Before Samsung Internet 9.0, this method was accessed through the HTMLDocument 别名。
xmlEncoding 弃用 非标 Chrome 1 Edge 12 Firefox No IE ? Opera ? Safari ? WebView Android Yes Chrome Android Yes Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android Yes
xmlStandalone 弃用 非标 Chrome 1 Edge 12 Firefox No IE ? Opera ? Safari ? WebView Android Yes Chrome Android Yes Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android Yes
xmlVersion 弃用 非标 Chrome 1 Edge 12 Firefox No IE ? Opera ? Safari ? WebView Android Yes Chrome Android Yes Firefox Android No Opera Android ? Safari iOS ? Samsung Internet Android Yes

图例

完整支持

完整支持

部分支持

部分支持

不支持

不支持

兼容性未知 ?

兼容性未知

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

弃用。不要用于新网站。

弃用。不要用于新网站。

见实现注意事项。

用户必须明确启用此特征。

用户必须明确启用此特征。

使用非标名称。

要求使用供应商前缀或不同名称。

要求使用供应商前缀或不同名称。

元数据

  • 最后修改:
  1. DOM (文档对象模型)
  2. Document
  3. 构造函数
    1. Document()
  4. 特性
    1. alinkColor
    2. all
    3. anchors
    4. applets
    5. bgColor
    6. body
    7. characterSet
    8. childElementCount
    9. children
    10. compatMode
    11. contentType
    12. currentScript
    13. defaultView
    14. designMode
    15. dir
    16. doctype
    17. documentElement
    18. documentURI
    19. documentURIObject
    20. domain
    21. domConfig
    22. 嵌入
    23. fgColor
    24. firstElementChild
    25. forms
    26. fullscreen
    27. fullscreenEnabled
    28. head
    29. height
    30. hidden
    31. 图像
    32. 实现
    33. lastElementChild
    34. lastModified
    35. lastStyleSheetSet
    36. linkColor
    37. 链接
    38. location
    39. mozSyntheticDocument
    40. onabort
    41. onafterscriptexecute
    42. onanimationcancel
    43. onanimationend
    44. onanimationiteration
    45. onauxclick
    46. onbeforescriptexecute
    47. onblur
    48. oncancel
    49. oncanplay
    50. oncanplaythrough
    51. onchange
    52. onclick
    53. onclose
    54. oncontextmenu
    55. oncuechange
    56. ondblclick
    57. ondurationchange
    58. onended
    59. onerror
    60. onfocus
    61. onformdata
    62. onfullscreenchange
    63. onfullscreenerror
    64. ongotpointercapture
    65. oninput
    66. oninvalid
    67. onkeydown
    68. onkeypress
    69. onkeyup
    70. onload
    71. onloadeddata
    72. onloadedmetadata
    73. onloadend
    74. onloadstart
    75. onlostpointercapture
    76. onmousedown
    77. onmouseenter
    78. onmouseleave
    79. onmousemove
    80. onmouseout
    81. onmouseover
    82. onmouseup
    83. onoffline
    84. ononline
    85. onpause
    86. onplay
    87. onplaying
    88. onpointercancel
    89. onpointerdown
    90. onpointerenter
    91. onpointerleave
    92. onpointermove
    93. onpointerout
    94. onpointerover
    95. onpointerup
    96. onreset
    97. onresize
    98. onscroll
    99. onselect
    100. onselectionchange
    101. onselectstart
    102. onsubmit
    103. ontouchcancel
    104. ontouchstart
    105. ontransitioncancel
    106. ontransitionend
    107. onvisibilitychange
    108. onwheel
    109. origin
    110. plugins
    111. popupNode
    112. preferredStyleSheetSet
    113. readyState
    114. referrer
    115. rootElement
    116. 脚本
    117. scrollingElement
    118. selectedStyleSheetSet
    119. styleSheetSets
    120. timeline
    121. title
    122. tooltipNode
    123. URL
    124. visibilityState
    125. vlinkColor
    126. width
    127. xmlEncoding
    128. xmlVersion
  5. 方法
    1. adoptNode()
    2. append()
    3. caretRangeFromPoint()
    4. clear()
    5. close()
    6. createAttribute()
    7. createCDATASection()
    8. createComment()
    9. createDocumentFragment()
    10. createElement()
    11. createElementNS()
    12. createEntityReference()
    13. createEvent()
    14. createExpression()
    15. createExpression()
    16. createNodeIterator()
    17. createNSResolver()
    18. createNSResolver()
    19. createProcessingInstruction()
    20. createRange()
    21. createTextNode()
    22. createTouch()
    23. createTouchList()
    24. createTreeWalker()
    25. enableStyleSheetsForSet()
    26. evaluate()
    27. evaluate()
    28. execCommand()
    29. exitFullscreen()
    30. exitPointerLock()
    31. getAnimations()
    32. getBoxObjectFor()
    33. getElementById()
    34. getElementsByClassName()
    35. getElementsByName()
    36. getElementsByTagName()
    37. getElementsByTagNameNS()
    38. hasFocus()
    39. hasStorageAccess()
    40. importNode()
    41. mozSetImageElement()
    42. open()
    43. prepend()
    44. queryCommandEnabled()
    45. queryCommandSupported()
    46. querySelector()
    47. querySelector()
    48. querySelectorAll()
    49. querySelectorAll()
    50. registerElement()
    51. releaseCapture()
    52. replaceChildren()
    53. requestStorageAccess()
    54. write()
    55. writeln()
  6. 事件
    1. animationcancel
    2. animationend
    3. animationiteration
    4. animationstart
    5. copy
    6. cut
    7. DOMContentLoaded
    8. drag
    9. dragend
    10. dragenter
    11. dragexit
    12. dragleave
    13. dragover
    14. dragstart
    15. drop
    16. fullscreenchange
    17. fullscreenerror
    18. gotpointercapture
    19. keydown
    20. keypress
    21. keyup
    22. lostpointercapture
    23. paste
    24. pointercancel
    25. pointerdown
    26. pointerenter
    27. pointerleave
    28. pointerlockchange
    29. pointerlockerror
    30. pointermove
    31. pointerout
    32. pointerover
    33. pointerup
    34. readystatechange
    35. scroll
    36. selectionchange
    37. selectstart
    38. touchcancel
    39. touchend
    40. touchmove
    41. touchstart
    42. transitioncancel
    43. transitionend
    44. transitionrun
    45. transitionstart
    46. visibilitychange
    47. wheel
  7. 继承:
    1. 节点
    2. EventTarget
  8. DOM 相关页面
    1. AbortController
    2. AbortSignal
    3. AbstractRange
    4. Attr
    5. ByteString
    6. CDATASection
    7. CSSPrimitiveValue
    8. CSSValue
    9. CSSValueList
    10. CharacterData
    11. ChildNode
    12. 注释
    13. CustomEvent
    14. DOMConfiguration
    15. DOMError
    16. DOMErrorHandler
    17. DOMException
    18. DOMImplementation
    19. DOMImplementationList
    20. DOMImplementationRegistry
    21. DOMImplementationSource
    22. DOMLocator
    23. DOMObject
    24. DOMParser
    25. DOMPoint
    26. DOMPointInit
    27. DOMPointReadOnly
    28. DOMRect
    29. DOMString
    30. DOMTimeStamp
    31. DOMTokenList
    32. DOMUserData
    33. DocumentFragment
    34. DocumentType
    35. 元素
    36. ElementTraversal
    37. Entity
    38. EntityReference
    39. 事件
    40. EventTarget
    41. HTMLCollection
    42. MutationObserver
    43. 节点
    44. NodeFilter
    45. NodeIterator
    46. NodeList
    47. NonDocumentTypeChildNode
    48. ProcessingInstruction
    49. PromiseResolver
    50. 范围
    51. StaticRange
    52. 文本
    53. TextDecoder
    54. TextEncoder
    55. TimeRanges
    56. TreeWalker
    57. TypeInfo
    58. USVString
    59. UserDataHandler
    60. XMLDocument

版权所有  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1