The HTML DOM API

HTML DOM API is made up of the interfaces that define the functionality of each of the elements in HTML , as well as any supporting types and interfaces they rely upon.

The functional areas included in the HTML DOM API include:

HTML DOM concepts and usage

In this article, we'll focus on the parts of the HTML DOM that involve engaging with HTML elements. Discussion of other areas, such as 拖放 , WebSockets , Web Storage , etc. can be found in the documentation for those APIs.

Structure of an HTML document

The Document Object Model ( DOM ) is an architecture that describes the structure of a document ; each document is represented by an instance of the interface Document . A document, in turn, consists of a hierarchical tree of nodes , in which a node is a fundamental record representing a single object within the document (such as an element or text node).

Nodes may be strictly organizational, providing a means for grouping other nodes together or for providing a point at which a hierarchy can be constructed; other nodes may represent visible components of a document. Each node is based on the Node interface, which provides properties for getting information about the node as well as methods for creating, deleting, and organizing nodes within the DOM.

Nodes don't have any concept of including the content that is actually displayed in the document. They're empty vessels. The fundamental notion of a node that can represent visual content is introduced by the Element interface. An Element object instance represents a single element in a document created using either HTML or an XML vocabulary such as SVG .

For example, consider a document with two elements, one of which has two more elements nested inside it:

Structure of a document with elements inside a document in a window

While the Document interface is defined as part of the DOM specification, the HTML specification significantly enhances it to add information specific to using the DOM in the context of a web browser, as well as to using it to represent HTML documents specifically.

Among the things added to Document by the HTML standard are:

HTML element interfaces

Element interface has been further adapted to represent HTML elements specifically by introducing the HTMLElement interface, which all more specific HTML element classes inherit from. This expands the Element class to add HTML-specific general features to the element nodes. Properties added by HTMLElement include for example hidden and innerText . HTMLElement also adds all the global event handlers .

An HTML document is a DOM tree in which each of the nodes is an HTML element, represented by the HTMLElement 接口。 HTMLElement class, in turn, implements Node , so every element is also a node (but not the other way around). This way, the structural features implemented by the Node interface are also available to HTML elements, allowing them to be nested within each other, created and deleted, moved around, and so forth.

HTMLElement interface is generic, however, providing only the functionality common to all HTML elements such as the element's ID, its coordinates, the HTML making up the element, information about scroll position, and so forth.

In order to expand upon the functionality of the core HTMLElement interface to provide the features needed by a specific element, the HTMLElement class is subclassed to add the needed properties and methods. For example, the <canvas> element is represented by an object of type HTMLCanvasElement . HTMLCanvasElement augments the HTMLElement type by adding properties such as height and methods like getContext() to provide canvas-specific features.

The overall inheritance for HTML element classes looks like this:

Hierarchy of interfaces for HTML elements

As such, an element inherits the properties and methods of all of its ancestors. For example, consider a <a> element, which is represented in the DOM by an object of type HTMLAnchorElement . The element, then, includes the anchor-specific properties and methods described in that class's documentation, but also those defined by HTMLElement and Element , as well as from Node and, finally, EventTarget .

Each level defines a key aspect of the utility of the element. From Node , the element inherits concepts surrounding the ability for the element to be contained by another element, and to contain other elements itself. Of special importance is what is gained by inheriting from EventTarget : the ability to receive and handle events such as mouse clicks, play and pause events, and so forth.

There are elements that share commonalities and thus have an additional intermediary type. For example, the <audio> and <video> elements both present audiovisual media. The corresponding types, HTMLAudioElement and HTMLVideoElement , are both based upon the common type HTMLMediaElement , which in turn is based upon HTMLElement and so forth. HTMLMediaElement defines the methods and properties held in common between audio and video elements.

These element-specific interfaces make up the majority of the HTML DOM API, and are the focus of this article. To learn more about the actual structure of the DOM , see Introduction to the DOM .

HTML DOM target audience

The features exposed by the HTML DOM are among the most commonly-used APIs in the web developer's arsenal. All but the most simple web applications will use some features of the HTML DOM.

HTML DOM API interfaces

The majority of the interfaces that comprise the HTML DOM API map almost one-to-one to individual HTML elements, or to a small group of elements with similar functionality. In addition, the HTML DOM API includes a few interfaces and types to support the HTML element interfaces.

HTML element interfaces

These interfaces represent specific HTML elements (or sets of related elements which have the same properties and methods associated with them).

Deprecated HTML Element Interfaces

Obsolete HTML Element Interfaces

Web app and browser integration interfaces

These interfaces offer access to the browser window and document that contain the HTML, as well as to the browser's state, available plugins (if any), and various configuration options.

Deprecated web app and browser integration interfaces

Obsolete web app and browser integration interfaces

Form support interfaces

These interfaces provide structure and functionality required by the elements used to create and manage forms, including the <form> and <input> elements.

Canvas and image interfaces

These interfaces represent objects used by the Canvas API as well as the <img> element and <picture> elements.

Media interfaces

The media interfaces provide HTML access to the contents of the media elements: <audio> and <video> .

Drag and drop interfaces

These interfaces are used by the HTML_Drag_and_Drop_API to represent individual draggable (or dragged) items, groups of dragged or draggable items, and to handle the drag and drop process.

Page history interfaces

The History API interfaces let you access information about the browser's history, as well as to shift the browser's current tab forward and backward through that history.

Web Components interfaces

These interfaces are used by the Web Components API to create and manage the available 自定义元素 .

Miscellaneous and supporting interfaces

These supporting object types are used in a variety of ways in the HTML DOM API. In addition, PromiseRejectionEvent represents the event delivered when a JavaScript Promise is rejected.

Interfaces belonging to other APIs

Several interfaces are technically defined in the HTML specification while actually being part of other APIs.

Web storage interfaces

Web_Storage_API provides the ability for web sites to store data either temporarily or permanently on the user's device for later re-use.

Web Workers interfaces

These interfaces are used by the Web_Workers_API both to establish the ability for workers to interact with an app and its content, but also to support messaging between windows or apps.

WebSocket interfaces

These interfaces, defined by the HTML specification, are used by the WebSockets_API .

Server-sent events interfaces

EventSource interface represents the source which sent or is sending server-sent events .

范例

In this example, an <input> element's input event is monitored in order to update the state of a form's "submit" button based on whether or not a given field currently has a value.

JavaScript

const nameField = document.getElementById("userName");
const sendButton = document.getElementById("sendButton")
sendButton.disabled = true;
// [note: this is disabled since it causes this article to always load with this example focused and scrolled into view]
//nameField.focus();
nameField.addEventListener("input", event => {
  const elem = event.target;
  const valid = elem.value.length != 0;
  if (valid && sendButton.disabled) {
    sendButton.disabled = false;
  } else if (!valid && !sendButton.disabled) {
    sendButton.disabled = true;
  }
});
					

This code uses the Document interface's getElementById() method to get the DOM object representing the <input> elements whose IDs are userName and sendButton .  With these, we can access the properties and methods that provide information about and grant control over these elements.

HTMLInputElement object for the "Send" button's disabled property is set to true , which disables the "Send" button so it can't be clicked. In addition, the user name input field is made the active focus by calling the focus() method it inherits from HTMLElement .

Then addEventListener() is called to add a handler for the input event to the user name input. This code looks at the length of the current value of the input; if it's zero, then the "Send" button is disabled if it's not already disabled. Otherwise, the code ensures that the button is enabled.

With this in place, the "Send" button is always enabled whenever the user name input field has a value, and disabled when it's empty.

HTML

The HTML for the form looks like this:

<p>Please provide the information below. Items marked with "*" are required.</p>
<form action="" method="get">
  <p>
    <label for="userName" required>Your name:</label>
    <input type="text" id="userName"> (*)
  </p>
  <p>
    <label for="email">Email:</label>
    <input type="email" id="userEmail">
  </p>
  <input type="submit" value="Send" id="sendButton">
</form>
					

结果

规范

规范 状态 Comment
HTML Living Standard 实时标准 WHATWG HTML Specification
HTML5 Recommendation No change from Document Object Model (DOM) Level 2 HTML Specification
Document Object Model (DOM) Level 2 HTML Specification Obsolete No change from Document Object Model (DOM) Level 1 Specification .
Document Object Model (DOM) Level 1 Specification Obsolete 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
HTMLElement Chrome 1 Edge 12 Firefox 1 IE 5.5 Opera 8 Safari 3 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
accessKey Chrome 17 Edge 12 Firefox 5 IE ? Opera Yes Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 5 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
accessKeyLabel Chrome 不支持 No Edge 不支持 No Firefox 8 IE ? Opera ? Safari ? WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 8 Opera Android ? Safari iOS ? Samsung Internet Android 不支持 No
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
autocapitalize Chrome 66 Edge ≤79 Firefox ? IE ? Opera ? Safari ? WebView Android 66 Chrome Android 66 Firefox Android ? Opera Android ? Safari iOS ? Samsung Internet Android 9.0
beforeinput event
Chrome Yes Edge 79 Firefox 不支持 No IE 不支持 No Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 不支持 No Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
blur Chrome 1 Edge 12 Firefox 5 IE 9 Opera 8 Safari 3 WebView Android 4.4 Chrome Android 18 Firefox Android 5 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
click() Chrome 9
注意事项
9
注意事项
Before Chrome 19, click() is only defined on buttons and inputs.
Edge 12 Firefox 3
注意事项
3
注意事项
Before Firefox 5, click() is only defined on buttons and inputs, and has no effect on text and file inputs.
Starting in Firefox 75, the click() function works even when the element is not attached to a DOM tree.
IE 8 Opera 10.5 Safari 6 WebView Android ≤37
注意事项
≤37
注意事项
Before Android WebView 4.4, click() is only defined on buttons and inputs.
Chrome Android 18
注意事项
18
注意事项
Before Chrome 19, click() is only defined on buttons and inputs.
Firefox Android 5 Opera Android 11 Safari iOS 6 Samsung Internet Android 1.0
注意事项
1.0
注意事项
Before Samsung Internet 1.5, click() is only defined on buttons and inputs.
contentEditable Chrome 1 Edge 12 Firefox 3 IE 8 Opera 9 Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
contextMenu
弃用 非标
Chrome 不支持 45 — 61 Edge 不支持 ≤18 — 79 Firefox 1 IE ? Opera ? Safari ? WebView Android 不支持 45 — 61 Chrome Android 不支持 45 — 61 Firefox Android 4 Opera Android ? Safari iOS ? Samsung Internet Android 不支持 5.0 — 8.0
dataset Chrome 8 Edge 12 Firefox 6 IE 11 Opera 11 Safari 5.1 WebView Android 4.4 Chrome Android 18 Firefox Android 6 Opera Android 11 Safari iOS 5.1 Samsung Internet Android 1.0
dir Chrome 1 Edge 12 Firefox 1 IE ? Opera Yes Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
draggable Chrome 7 Edge 12 Firefox 2 IE Yes Opera 12 Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
dropzone Chrome 不支持 14 — 59 Edge 不支持 ≤18 — 79 Firefox 1 IE ? Opera ? Safari ? WebView Android 不支持 4.4 — 59 Chrome Android 不支持 18 — 59 Firefox Android 4 Opera Android ? Safari iOS ? Samsung Internet Android 不支持 1.0 — 7.0
focus Chrome 1 Edge 12 Firefox 5 IE 9 Opera 8 Safari 3 WebView Android 4.4 Chrome Android 18 Firefox Android 5 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
forceSpellCheck
非标
Chrome 不支持 No Edge 不支持 No Firefox 不支持 No IE 不支持 No Opera 不支持 No Safari ? WebView Android 不支持 No Chrome Android 不支持 No Firefox Android 4 Opera Android ? Safari iOS ? Samsung Internet Android 不支持 No
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
hidden Chrome 6 Edge 12 Firefox 1 IE 11 Opera 11.6 Safari 6 WebView Android ≤37 Chrome Android 18 Firefox Android 4 Opera Android 12 Safari iOS 6 Samsung Internet Android 1.0
inert Chrome 60 Edge ≤18 Firefox ? IE ? Opera 47 Safari ? WebView Android 60 Chrome Android 60 Firefox Android ? Opera Android 44 Safari iOS ? Samsung Internet Android 8.0
innerText Chrome 1 Edge 12 Firefox 45 IE 5.5 Opera 9.6 Safari 3 WebView Android 4.4 Chrome Android 18 Firefox Android 45 Opera Android 10.1 Safari iOS 4 Samsung Internet Android 1.0
input event Chrome 1 Edge 79
79
12 — 79
注意事项
Not supported on select , checkbox ,或 radio inputs.
Firefox 6 IE 部分支持 9
注意事项
部分支持 9
注意事项
Only supports input of type text and password .
Opera 11.6 Safari 3.1 WebView Android 1 Chrome Android 18 Firefox Android 6 Opera Android 12 Safari iOS 2 Samsung Internet Android 1.0
inputMode Chrome 66 Edge ≤79 Firefox ? IE ? Opera Yes Safari ? WebView Android 66 Chrome Android 66 Firefox Android ? Opera Android Yes Safari iOS ? Samsung Internet Android 9.0
isContentEditable Chrome 1 Edge 12 Firefox 1 IE ? Opera Yes Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
itemId
Chrome 不支持 17 — 28 Edge 不支持 No Firefox 6 IE 不支持 No Opera 不支持 11 — 15 Safari ? WebView Android 不支持 No Chrome Android 不支持 18 — 28 Firefox Android 4 Opera Android ? Safari iOS ? Samsung Internet Android 不支持 1.0 — 1.5
itemProp
Chrome 不支持 17 — 28 Edge 不支持 No Firefox 6 IE 不支持 No Opera 不支持 11 — 15 Safari ? WebView Android 不支持 No Chrome Android 不支持 18 — 28 Firefox Android 4 Opera Android ? Safari iOS ? Samsung Internet Android 不支持 1.0 — 1.5
itemRef
Chrome 不支持 17 — 28 Edge 不支持 No Firefox 6 IE 不支持 No Opera 不支持 11 — 15 Safari ? WebView Android 不支持 No Chrome Android 不支持 18 — 28 Firefox Android 4 Opera Android ? Safari iOS ? Samsung Internet Android 不支持 1.0 — 1.5
itemScope
Chrome 不支持 17 — 28 Edge 不支持 No Firefox 6 IE 不支持 No Opera 不支持 11 — 15 Safari ? WebView Android 不支持 No Chrome Android 不支持 18 — 28 Firefox Android 4 Opera Android ? Safari iOS ? Samsung Internet Android 不支持 1.0 — 1.5
itemType
Chrome 不支持 17 — 28 Edge 不支持 No Firefox 6 IE 不支持 No Opera 不支持 11 — 15 Safari ? WebView Android 不支持 No Chrome Android 不支持 18 — 28 Firefox Android 4 Opera Android ? Safari iOS ? Samsung Internet Android 不支持 1.0 — 1.5
itemValue Chrome 不支持 17 — 28 Edge 不支持 No Firefox 6 IE 不支持 No Opera 不支持 11 — 15 Safari ? WebView Android 不支持 No Chrome Android 不支持 18 — 28 Firefox Android 4 Opera Android ? Safari iOS ? Samsung Internet Android 不支持 1.0 — 1.5
lang Chrome 1 Edge 12 Firefox 1 IE ? Opera Yes Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes 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
noModule Chrome 60 Edge ≤79 Firefox ? IE 不支持 No Opera 47 Safari ? WebView Android 60 Chrome Android 60 Firefox Android ? Opera Android 44 Safari iOS ? Samsung Internet Android 8.0
nonce Chrome 61 Edge 79 Firefox 75 IE 不支持 No Opera Yes Safari 10 WebView Android 61 Chrome Android 61 Firefox Android 不支持 No Opera Android Yes Safari iOS 10 Samsung Internet Android 8.0
offsetHeight Chrome 1 Edge 12 Firefox 1 IE 8 Opera 8 Safari 3 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
offsetLeft Chrome 1 Edge 12 Firefox 1 IE 8 Opera 8 Safari 3 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
offsetParent Chrome 1 Edge 12 Firefox 1 IE 8 Opera 8 Safari 3 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
offsetTop Chrome 1 Edge 12 Firefox 1 IE 8 Opera 8 Safari 3 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
offsetWidth Chrome 1 Edge 12 Firefox 1 IE 8 Opera 8 Safari 3 WebView Android 1 Chrome Android 18 Firefox Android 4 Opera Android 10.1 Safari iOS 1 Samsung Internet Android 1.0
oncopy
非标
Chrome 71 Edge 12 Firefox 3 IE ? Opera Yes Safari Yes WebView Android 71 Chrome Android 71 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 10.0
oncut
非标
Chrome 71 Edge 12 Firefox 3 IE ? Opera Yes Safari Yes WebView Android 71 Chrome Android 71 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 10.0
onModule Chrome 60 Edge ≤79 Firefox ? IE ? Opera 47 Safari ? WebView Android 60 Chrome Android 60 Firefox Android ? Opera Android 44 Safari iOS ? Samsung Internet Android 8.0
onpaste
非标
Chrome 71 Edge 12 Firefox 3 IE ? Opera Yes Safari Yes WebView Android 71 Chrome Android 71 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 10.0
outerText
非标
Chrome 43 Edge 12 Firefox 不支持 No IE Yes Opera Yes Safari 6 WebView Android 43 Chrome Android 43 Firefox Android 不支持 No Opera Android Yes Safari iOS Yes Samsung Internet Android 4.0
pointercancel event Chrome 55 Edge 12
12
12 — 79
Alternate Name
Alternate Name Uses the non-standard name: mspointercancel
Firefox 59
59
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
Disabled
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
Disabled
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
Disabled
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
Disabled
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android ? Safari iOS 不支持 No Samsung Internet Android 6.0
pointermove event Chrome 55 Edge 12
12
12 — 79
Alternate Name
Alternate Name Uses the non-standard name: mspointermove
Firefox 59
59
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
Disabled
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
Disabled
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
Disabled
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
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
Disabled
29
Disabled
Disabled From version 29: this feature is behind the dom.w3c_pointer_events.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android ? Safari iOS 不支持 No Samsung Internet Android 6.0
spellcheck Chrome 43 Edge 12 Firefox 2 IE ? Opera Yes Safari 6 WebView Android 43 Chrome Android 43 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 4.0
style Chrome 45 Edge 12 Firefox 1 IE 8 Opera 8 Safari 11 WebView Android 45 Chrome Android 45 Firefox Android 4 Opera Android 10.1 Safari iOS 11 Samsung Internet Android 5.0
tabIndex Chrome 1 Edge 18
18
部分支持 12
注意事项
Returns incorrect value for elements without an explicit tabindex attribute. See issue 4365703 了解细节。
Firefox 1 IE 部分支持 8
注意事项
部分支持 8
注意事项
Returns incorrect value for elements without an explicit tabindex attribute. See issue 4365703 了解细节。
Opera Yes Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
title Chrome 1 Edge 12 Firefox 1 IE ? Opera Yes Safari 6 WebView Android 4.4 Chrome Android 18 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.0
transitioncancel event Chrome 74 Edge ≤79 Firefox 53 IE ? Opera 62 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 74 Chrome Android 74 Firefox Android 53 Opera Android 53 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 11.0
transitionend event Chrome 26
26
1
Alternate Name
Alternate Name Uses the non-standard name: webkitTransitionEnd
Edge ≤79
≤79
≤79
Alternate Name
Alternate Name Uses the non-standard name: webkitTransitionEnd
Firefox 51 IE 10 Opera 12.1
12.1
15
Alternate Name
Alternate Name Uses the non-standard name: webkitTransitionEnd
11.6 — 15
Alternate Name
Alternate Name Uses the non-standard name: oTransitionEnd
Safari 6.1
6.1
4
Alternate Name
Alternate Name Uses the non-standard name: webkitTransitionEnd
WebView Android ≤37
≤37
1
Alternate Name
Alternate Name Uses the non-standard name: webkitTransitionEnd
Chrome Android 26
26
18
Alternate Name
Alternate Name Uses the non-standard name: webkitTransitionEnd
Firefox Android 51 Opera Android 12.1
12.1
14
Alternate Name
Alternate Name Uses the non-standard name: webkitTransitionEnd
12 — 14
Alternate Name
Alternate Name Uses the non-standard name: oTransitionEnd
Safari iOS 7
7
3.2
Alternate Name
Alternate Name Uses the non-standard name: webkitTransitionEnd
Samsung Internet Android 1.5
1.5
1.0
Alternate Name
Alternate Name Uses the non-standard name: webkitTransitionEnd
transitionrun event Chrome 74 Edge ≤79 Firefox 53 IE ? Opera 62 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 74 Chrome Android 74 Firefox Android 53 Opera Android 53 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 11.0
transitionstart event Chrome 74 Edge ≤79 Firefox 53 IE ? Opera 62 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 74 Chrome Android 74 Firefox Android 53 Opera Android 53 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 11.0
translate
Chrome 19 Edge 79 Firefox 不支持 No IE 不支持 No Opera 不支持 No Safari 6 WebView Android 4.4 Chrome Android 25 Firefox Android 4 Opera Android Yes Safari iOS Yes Samsung Internet Android 1.5

图例

完整支持
完整支持
部分支持
部分支持
不支持
不支持
兼容性未知
兼容性未知
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。
非标。预期跨浏览器支持较差。
弃用。不要用于新网站。
弃用。不要用于新网站。
见实现注意事项。
用户必须明确启用此特征。
用户必须明确启用此特征。
使用非标名称。
使用非标名称。

另请参阅

References
指南
  1. 接口
    1. BeforeUnloadEvent
    2. DOMStringMap
    3. ErrorEvent
    4. GlobalEventHandlers
    5. HashChangeEvent
    6. ImageData
    7. HTMLAnchorElement
    8. HTMLAreaElement
    9. HTMLAudioElement
    10. HTMLBaseElement
    11. HTMLBaseFontElement
    12. HTMLBodyElement
    13. HTMLBRElement
    14. HTMLButtonElement
    15. HTMLCanvasElement
    16. HTMLContentElement
    17. HTMLDataElement
    18. HTMLDataListElement
    19. HTMLDialogElement
    20. HTMLDivElement
    21. HTMLDListElement
    22. HTMLDocument
    23. HTMLElement
    24. HTMLEmbedElement
    25. HTMLFieldSetElement
    26. HTMLFormControlsCollection
    27. HTMLFormElement
    28. HTMLFrameSetElement
    29. HTMLHeadElement
    30. HTMLHeadingElement
    31. HTMLHRElement
    32. HTMLHtmlElement
    33. HTMLIFrameElement
    34. HTMLImageElement
    35. HTMLInputElement
    36. HTMLIsIndexElement
    37. HTMLKeygenElement
    38. HTMLLabelElement
    39. HTMLLegendElement
    40. HTMLLIElement
    41. HTMLLinkElement
    42. HTMLMapElement
    43. HTMLMediaElement
    44. HTMLMetaElement
    45. HTMLMeterElement
    46. HTMLModElement
    47. HTMLObjectElement
    48. HTMLOListElement
    49. HTMLOptGroupElement
    50. HTMLOptionElement
    51. HTMLOptionsCollection
    52. HTMLOutputElement
    53. HTMLParagraphElement
    54. HTMLParamElement
    55. HTMLPictureElement
    56. HTMLPreElement
    57. HTMLProgressElement
    58. HTMLQuoteElement
    59. HTMLScriptElement
    60. HTMLSelectElement
    61. HTMLShadowElement
    62. HTMLSourceElement
    63. HTMLSpanElement
    64. HTMLStyleElement
    65. HTMLTableCaptionElement
    66. HTMLTableCellElement
    67. HTMLTableColElement
    68. HTMLTableDataCellElement
    69. HTMLTableElement
    70. HTMLTableHeaderCellElement
    71. HTMLTableRowElement
    72. HTMLTableSectionElement
    73. HTMLTextAreaElement
    74. HTMLTemplateElement
    75. HTMLTimeElement
    76. HTMLTitleElement
    77. HTMLTrackElement
    78. HTMLUListElement
    79. HTMLUnknownElement
    80. HTMLVideoElement
    81. History
    82. Location
    83. MessageChannel
    84. MessageEvent
    85. MessagePort
    86. Navigator
    87. NavigatorGeolocation
    88. NavigatorID
    89. NavigatorLanguage
    90. NavigatorOnLine
    91. NavigatorPlugins
    92. PageTransitionEvent
    93. Plugin
    94. PluginArray
    95. PopStateEvent
    96. PortCollection
    97. PromiseRejectionEvent
    98. RadioNodeList
    99. Transferable
    100. ValidityState
    101. Window
    102. WindowBase64
    103. WindowEventHandlers
    104. WindowTimers
  2. Events
    1. Document : DOMContentLoaded
    2. Document : readystatechange
    3. Element : DOMActivate
    4. Element : afterscriptexecute
    5. Element : auxclick
    6. Element : beforescriptexecute
    7. Element : blur
    8. Element : click
    9. Element : contextmenu
    10. Element : focus
    11. Element : select
    12. Element : show
    13. HTMLDetailsElement : toggle
    14. HTMLDialogElement : cancel
    15. HTMLDialogElement : close
    16. HTMLElement : input
    17. HTMLFormElement : reset
    18. HTMLFormElement : submit
    19. HTMLInputElement : change
    20. HTMLInputElement : invalid
    21. HTMLMediaElement : abort
    22. HTMLMediaElement : canplay
    23. HTMLMediaElement : canplaythrough
    24. HTMLMediaElement : durationchange
    25. HTMLMediaElement : emptied
    26. HTMLMediaElement : error
    27. HTMLMediaElement : loadeddata
    28. HTMLMediaElement : loadedmetadata
    29. HTMLMediaElement : loadstart
    30. HTMLMediaElement : play
    31. HTMLMediaElement : playing
    32. HTMLMediaElement : progress
    33. HTMLMediaElement : seeked
    34. HTMLMediaElement : seeking
    35. HTMLMediaElement : stalled
    36. HTMLMediaElement : suspend
    37. HTMLMediaElement : timeupdate
    38. HTMLMediaElement : volumechange
    39. HTMLMediaElement : waiting
    40. Window : afterprint
    41. Window : beforeprint
    42. Window : beforeunload
    43. Window : hashchange
    44. Window : languagechange
    45. Window : load
    46. Window : message
    47. Window : offline
    48. Window : online
    49. Window : pagehide
    50. Window : pageshow
    51. Window : popstate
    52. Window : rejectionhandled
    53. Window : storage
    54. Window : unhandledrejection
    55. Window : unload