Web/API/HTML DOM API

From Get docs

The 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:

  • Access to and control of HTML elements via the [[../../../Glossary/DOM|DOM]].
  • Access to and manipulation of form data.
  • Interacting with the contents of 2D images and the context of an HTML <canvas>, for example to draw on top of them.
  • Management of media connected to the HTML media elements (<audio> and <video>).
  • Dragging and dropping of content on webpages.
  • Access to the browser navigation history
  • Supporting and connective interfaces for other APIs such as Web Components, Web Storage, Web Workers, WebSocket, and Server-sent events.

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 Drag and Drop, WebSockets, Web Storage, etc. can be found in the documentation for those APIs.

Structure of an HTML document

The Document Object Model ([[../../../Glossary/DOM|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:

[[File:../../../../../media.prod.mdn.mozit.cloud/attachments/2019/04/23/16587/925c5a845b4f5d416e6485d9889f36cb/dom-structure.svg|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

The 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 interface. The 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.

The 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:

[[File:../../../../../media.prod.mdn.mozit.cloud/attachments/2019/04/29/16596/56658d424064f935f6fde4d63083d982/html-dom-hierarchy.svg|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 custom elements.

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

The 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

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

Examples

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.

The 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>

Result

Specifications

Specification Status Comment
HTML Living Standard 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 Initial definition.

Browser compatibility

Update compatibility data on 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

Full support 1

Edge

Full support 12

Firefox

Full support 1

IE

Full support 5.5

Opera

Full support 8

Safari

Full support 3

WebView Android

Full support 1

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support 10.1

Safari iOS

Full support 1

Samsung Internet Android

Full support 1.0

accessKey Chrome

Full support 17

Edge

Full support 12

Firefox

Full support 5

IE

?

Opera

Full support Yes

Safari

Full support 6

WebView Android

Full support 4.4

Chrome Android

Full support 18

Firefox Android

Full support 5

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 1.0

accessKeyLabel Chrome

No support No

Edge

No support No

Firefox

Full support 8

IE

No support No

Opera

?

Safari

Full support 14

WebView Android

No support No

Chrome Android

No support No

Firefox Android

Full support 8

Opera Android

?

Safari iOS

Full support 14

Samsung Internet Android

No support No

animationcancel event Chrome

No support No

Edge

No support No

Firefox

Full support 54

IE

No support No

Opera

No support No

Safari Full support 13.1


Full support 13.1


Full support 12

Disabled'

Disabled' From version 12: this feature is behind the Web Animations preference and the CSS Animations via Web Animations preference.

WebView Android

No support No

Chrome Android

No support No

Firefox Android

Full support 54

Opera Android

No support No

Safari iOS Full support 13.4


Full support 13.4


Full support 12

Disabled'

Disabled' From version 12: this feature is behind the Web Animations preference and the CSS Animations via Web Animations preference.

Samsung Internet Android

No support No

animationend event Chrome

Full support 43

Edge

Full support 12

Firefox

Full support Yes

IE

Full support 10

Opera

Full support 30

Safari

Full support 9

WebView Android

Full support 43

Chrome Android

Full support 43

Firefox Android

Full support Yes

Opera Android

Full support 30

Safari iOS

Full support 9

Samsung Internet Android

Full support 4.0

animationiteration event Chrome

Full support 43

Edge

Full support 12

Firefox

Full support 51

IE

Full support 10

Opera

Full support 30

Safari

Full support 9

WebView Android

Full support 43

Chrome Android

Full support 43

Firefox Android

Full support 51

Opera Android

Full support 30

Safari iOS

Full support 9

Samsung Internet Android

Full support 4.0

animationstart event Chrome

Full support 43

Edge

Full support 12

Firefox

Full support 51

IE

Full support 10

Opera

Full support 30

Safari

Full support 9

WebView Android

Full support 43

Chrome Android

Full support 43

Firefox Android

Full support 51

Opera Android

Full support 30

Safari iOS

Full support 9

Samsung Internet Android

Full support 4.0

autocapitalize Chrome

Full support 66

Edge

Full support ≤79

Firefox

?

IE

No support No

Opera

?

Safari

?

WebView Android

Full support 66

Chrome Android

Full support 66

Firefox Android

?

Opera Android

?

Safari iOS

?

Samsung Internet Android

Full support 9.0

beforeinput event

Experimental'

Chrome

Full support Yes

Edge

Full support 79

Firefox

No support No

IE

No support No

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support Yes

Chrome Android

Full support Yes

Firefox Android

No support No

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

blur Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 5

IE

Full support 9

Opera

Full support 8

Safari

Full support 3

WebView Android

Full support 4.4

Chrome Android

Full support 18

Firefox Android

Full support 5

Opera Android

Full support 10.1

Safari iOS

Full support 1

Samsung Internet Android

Full support 1.0

click()

Chrome Full support 9

Notes'

Full support 9

Notes'

Notes' Before Chrome 19, click() is only defined on buttons and inputs.

Edge

Full support 12

Firefox Full support 3

Notes'

Full support 3

Notes'

Notes' Before Firefox 5, click() is only defined on buttons and inputs, and has no effect on text and file inputs. Notes' Starting in Firefox 75, the click() function works even when the element is not attached to a DOM tree.

IE

Full support 8

Opera

Full support 10.5

Safari

Full support 6

WebView Android Full support ≤37

Notes'

Full support ≤37

Notes'

Notes' Before Android WebView 4.4, click() is only defined on buttons and inputs.

Chrome Android Full support 18

Notes'

Full support 18

Notes'

Notes' Before Chrome 19, click() is only defined on buttons and inputs.

Firefox Android

Full support 5

Opera Android

Full support 11

Safari iOS

Full support 6

Samsung Internet Android Full support 1.0

Notes'

Full support 1.0

Notes'

Notes' Before Samsung Internet 1.5, click() is only defined on buttons and inputs.

contentEditable Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 3

IE

Full support 8

Opera

Full support 9

Safari

Full support 6

WebView Android

Full support 4.4

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 1.0

contextMenu

Deprecated'Non-standard'

Chrome

No support 45 — 61

Edge

No support ≤18 — 79

Firefox

Full support 1

IE

?

Opera

?

Safari

?

WebView Android

No support 45 — 61

Chrome Android

No support 45 — 61

Firefox Android

Full support 4

Opera Android

?

Safari iOS

?

Samsung Internet Android

No support 5.0 — 8.0

dataset Chrome

Full support 8

Edge

Full support 12

Firefox

Full support 6

IE

Full support 11

Opera

Full support 11

Safari

Full support 5.1

WebView Android

Full support 4.4

Chrome Android

Full support 18

Firefox Android

Full support 6

Opera Android

Full support 11

Safari iOS

Full support 5.1

Samsung Internet Android

Full support 1.0

dir Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 1

IE

?

Opera

Full support Yes

Safari

Full support 6

WebView Android

Full support 4.4

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 1.0

draggable Chrome

Full support 7

Edge

Full support 12

Firefox

Full support 2

IE

Full support Yes

Opera

Full support 12

Safari

Full support 6

WebView Android

Full support 4.4

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 1.0

dropzone Chrome

No support 14 — 59

Edge

No support ≤18 — 79

Firefox

Full support 1

IE

?

Opera

?

Safari

?

WebView Android

No support 4.4 — 59

Chrome Android

No support 18 — 59

Firefox Android

Full support 4

Opera Android

?

Safari iOS

?

Samsung Internet Android

No support 1.0 — 7.0

enterKeyHint Chrome

Full support 77

Edge

No support No

Firefox Full support 79

Disabled'

Full support 79

Disabled'

Disabled' From version 79: this feature is behind the dom.forms.enterkeyhint preference (needs to be set to true). To change preferences in Firefox, visit about:config.

IE

No support No

Opera

No support No

Safari

Full support 13.1

WebView Android

Full support 77

Chrome Android

Full support 77

Firefox Android Full support 79

Disabled'

Full support 79

Disabled'

Disabled' From version 79: this feature is behind the dom.forms.enterkeyhint preference (needs to be set to true). To change preferences in Firefox, visit about:config.

Opera Android

No support No

Safari iOS

Full support 13.4

Samsung Internet Android

No support No

focus Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 5

IE

Full support 9

Opera

Full support 8

Safari

Full support 3

WebView Android

Full support 4.4

Chrome Android

Full support 18

Firefox Android

Full support 5

Opera Android

Full support 10.1

Safari iOS

Full support 1

Samsung Internet Android

Full support 1.0

forceSpellCheck

Non-standard'

Chrome

No support No

Edge

No support No

Firefox

No support No

IE

No support No

Opera

No support No

Safari

?

WebView Android

No support No

Chrome Android

No support No

Firefox Android

Full support 4

Opera Android

?

Safari iOS

?

Samsung Internet Android

No support No

gotpointercapture event Chrome

Full support 57

Edge

Full support ≤79

Firefox

Full support 59

IE

?

Opera

Full support 44

Safari

?

WebView Android

Full support 57

Chrome Android

Full support 57

Firefox Android

No support No

Opera Android

Full support 43

Safari iOS

?

Samsung Internet Android

Full support 7.0

hidden Chrome

Full support 6

Edge

Full support 12

Firefox

Full support 1

IE

Full support 11

Opera

Full support 11.6

Safari

Full support 6

WebView Android

Full support ≤37

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support 12

Safari iOS

Full support 6

Samsung Internet Android

Full support 1.0

inert

Chrome Full support 60

Disabled'

Full support 60

Disabled'

Disabled' From version 60: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.

Edge Full support 79

Disabled'

Full support 79

Disabled'

Disabled' From version 79: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to Enabled).

Firefox Full support 81

Disabled'

Full support 81

Disabled'

Disabled' From version 81: this feature is behind the html5.inert.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

IE

No support No

Opera Full support 47

Disabled'

Full support 47

Disabled'

Disabled' From version 47: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to Enabled).

Safari

No support No

WebView Android

No support No

Chrome Android Full support 60

Disabled'

Full support 60

Disabled'

Disabled' From version 60: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.

Firefox Android Full support 81

Disabled'

Full support 81

Disabled'

Disabled' From version 81: this feature is behind the html5.inert.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

Opera Android Full support 44

Disabled'

Full support 44

Disabled'

Disabled' From version 44: this feature is behind the #enable-experimental-web-platform-features preference (needs to be set to Enabled).

Safari iOS

No support No

Samsung Internet Android

No support No

innerText Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 45

IE

Full support 5.5

Opera

Full support 9.6

Safari

Full support 3

WebView Android

Full support 4.4

Chrome Android

Full support 18

Firefox Android

Full support 45

Opera Android

Full support 10.1

Safari iOS

Full support 4

Samsung Internet Android

Full support 1.0

input event Chrome

Full support 1

Edge Full support 79


Full support 79


No support 12 — 79

Notes'

Notes' Not supported on select, checkbox, or radio inputs.

Firefox

Full support 6

IE Partial support 9

Notes'

Partial support 9

Notes'

Notes' Only supports input of type text and password.

Opera

Full support 11.6

Safari

Full support 3.1

WebView Android

Full support 1

Chrome Android

Full support 18

Firefox Android

Full support 6

Opera Android

Full support 12

Safari iOS

Full support 2

Samsung Internet Android

Full support 1.0

inputMode Chrome

Full support 66

Edge

Full support ≤79

Firefox Full support 77

Disabled'

Full support 77

Disabled'

Disabled' From version 77: this feature is behind the dom.forms.inputmode preference (needs to be set to true). To change preferences in Firefox, visit about:config.

IE

No support No

Opera

Full support Yes

Safari

?

WebView Android

Full support 66

Chrome Android

Full support 66

Firefox Android

Full support 79

Opera Android

Full support Yes

Safari iOS

?

Samsung Internet Android

Full support 9.0

isContentEditable Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 1

IE

?

Opera

Full support Yes

Safari

Full support 6

WebView Android

Full support 4.4

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 1.0

itemId

Experimental'

Chrome

No support 17 — 28

Edge

No support No

Firefox

Full support 6

IE

No support No

Opera

No support 11 — 15

Safari

?

WebView Android

No support No

Chrome Android

No support 18 — 28

Firefox Android

Full support 4

Opera Android

?

Safari iOS

?

Samsung Internet Android

No support 1.0 — 1.5

itemProp

Experimental'

Chrome

No support 17 — 28

Edge

No support No

Firefox

Full support 6

IE

No support No

Opera

No support 11 — 15

Safari

?

WebView Android

No support No

Chrome Android

No support 18 — 28

Firefox Android

Full support 4

Opera Android

?

Safari iOS

?

Samsung Internet Android

No support 1.0 — 1.5

itemRef

Experimental'

Chrome

No support 17 — 28

Edge

No support No

Firefox

Full support 6

IE

No support No

Opera

No support 11 — 15

Safari

?

WebView Android

No support No

Chrome Android

No support 18 — 28

Firefox Android

Full support 4

Opera Android

?

Safari iOS

?

Samsung Internet Android

No support 1.0 — 1.5

itemScope

Experimental'

Chrome

No support 17 — 28

Edge

No support No

Firefox

Full support 6

IE

No support No

Opera

No support 11 — 15

Safari

?

WebView Android

No support No

Chrome Android

No support 18 — 28

Firefox Android

Full support 4

Opera Android

?

Safari iOS

?

Samsung Internet Android

No support 1.0 — 1.5

itemType

Experimental'

Chrome

No support 17 — 28

Edge

No support No

Firefox

Full support 6

IE

No support No

Opera

No support 11 — 15

Safari

?

WebView Android

No support No

Chrome Android

No support 18 — 28

Firefox Android

Full support 4

Opera Android

?

Safari iOS

?

Samsung Internet Android

No support 1.0 — 1.5

itemValue Chrome

No support 17 — 28

Edge

No support No

Firefox

Full support 6

IE

No support No

Opera

No support 11 — 15

Safari

?

WebView Android

No support No

Chrome Android

No support 18 — 28

Firefox Android

Full support 4

Opera Android

?

Safari iOS

?

Samsung Internet Android

No support 1.0 — 1.5

lang Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 1

IE

?

Opera

Full support Yes

Safari

Full support 6

WebView Android

Full support 4.4

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 1.0

lostpointercapture event Chrome

Full support 57

Edge

Full support ≤79

Firefox

Full support 59

IE

?

Opera

Full support 44

Safari

?

WebView Android

Full support 57

Chrome Android

Full support 57

Firefox Android

No support No

Opera Android

Full support 43

Safari iOS

?

Samsung Internet Android

Full support 7.0

noModule Chrome

Full support 60

Edge

Full support ≤79

Firefox

?

IE

No support No

Opera

Full support 47

Safari

?

WebView Android

Full support 60

Chrome Android

Full support 60

Firefox Android

?

Opera Android

Full support 44

Safari iOS

?

Samsung Internet Android

Full support 8.0

nonce Chrome

Full support 61

Edge

Full support 79

Firefox

Full support 75

IE

No support No

Opera

Full support Yes

Safari

Full support 10

WebView Android

Full support 61

Chrome Android

Full support 61

Firefox Android

No support No

Opera Android

Full support Yes

Safari iOS

Full support 10

Samsung Internet Android

Full support 8.0

offsetHeight Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 1

IE

Full support 8

Opera

Full support 8

Safari

Full support 3

WebView Android

Full support 1

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support 10.1

Safari iOS

Full support 1

Samsung Internet Android

Full support 1.0

offsetLeft Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 1

IE

Full support 8

Opera

Full support 8

Safari

Full support 3

WebView Android

Full support 1

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support 10.1

Safari iOS

Full support 1

Samsung Internet Android

Full support 1.0

offsetParent Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 1

IE

Full support 8

Opera

Full support 8

Safari

Full support 3

WebView Android

Full support 1

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support 10.1

Safari iOS

Full support 1

Samsung Internet Android

Full support 1.0

offsetTop Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 1

IE

Full support 8

Opera

Full support 8

Safari

Full support 3

WebView Android

Full support 1

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support 10.1

Safari iOS

Full support 1

Samsung Internet Android

Full support 1.0

offsetWidth Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 1

IE

Full support 8

Opera

Full support 8

Safari

Full support 3

WebView Android

Full support 1

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support 10.1

Safari iOS

Full support 1

Samsung Internet Android

Full support 1.0

oncopy

Non-standard'

Chrome

Full support 71

Edge

Full support 12

Firefox

Full support 3

IE

?

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support 71

Chrome Android

Full support 71

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 10.0

oncut

Non-standard'

Chrome

Full support 71

Edge

Full support 12

Firefox

Full support 3

IE

?

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support 71

Chrome Android

Full support 71

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 10.0

onModule Chrome

Full support 60

Edge

Full support ≤79

Firefox

?

IE

?

Opera

Full support 47

Safari

?

WebView Android

Full support 60

Chrome Android

Full support 60

Firefox Android

?

Opera Android

Full support 44

Safari iOS

?

Samsung Internet Android

Full support 8.0

onpaste

Non-standard'

Chrome

Full support 71

Edge

Full support 12

Firefox

Full support 3

IE

?

Opera

Full support Yes

Safari

Full support Yes

WebView Android

Full support 71

Chrome Android

Full support 71

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 10.0

outerText

Non-standard'

Chrome

Full support 43

Edge

Full support 12

Firefox

No support No

IE

Full support Yes

Opera

Full support Yes

Safari

Full support 6

WebView Android

Full support 43

Chrome Android

Full support 43

Firefox Android

No support No

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 4.0

pointercancel event Chrome

Full support 55

Edge Full support 12


Full support 12


No support 12 — 79

Alternate Name'

Alternate Name' Uses the non-standard name: mspointercancel

Firefox Full support 59


Full support 59


Full support 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 Full support 11


Full support 11


Full support 10

Alternate Name'

Alternate Name' Uses the non-standard name: mspointercancel

Opera

?

Safari

No support No

WebView Android

Full support 55

Chrome Android

Full support 55

Firefox Android Full support 29

Disabled'

Full support 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 support No

Samsung Internet Android

Full support 6.0

pointerdown event Chrome

Full support 55

Edge Full support 12


Full support 12


No support 12 — 79

Alternate Name'

Alternate Name' Uses the non-standard name: mspointerdown

Firefox Full support 59


Full support 59


Full support 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 Full support 11


Full support 11


Full support 10

Alternate Name'

Alternate Name' Uses the non-standard name: mspointerdown

Opera

?

Safari

No support No

WebView Android

Full support 55

Chrome Android

Full support 55

Firefox Android Full support 29

Disabled'

Full support 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 support No

Samsung Internet Android

Full support 6.0

pointerenter event Chrome

Full support 55

Edge Full support 12


Full support 12


No support 12 — 79

Alternate Name'

Alternate Name' Uses the non-standard name: mspointerenter

Firefox Full support 59


Full support 59


Full support 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 Full support 11


Full support 11


Full support 10

Alternate Name'

Alternate Name' Uses the non-standard name: mspointerenter

Opera

?

Safari

No support No

WebView Android

Full support 55

Chrome Android

Full support 55

Firefox Android Full support 29

Disabled'

Full support 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 support No

Samsung Internet Android

Full support 6.0

pointerleave event Chrome

Full support 55

Edge Full support 12


Full support 12


No support 12 — 79

Alternate Name'

Alternate Name' Uses the non-standard name: mspointerleave

Firefox Full support 59


Full support 59


Full support 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 Full support 11


Full support 11


Full support 10

Alternate Name'

Alternate Name' Uses the non-standard name: mspointerleave

Opera

?

Safari

No support No

WebView Android

Full support 55

Chrome Android

Full support 55

Firefox Android Full support 29

Disabled'

Full support 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 support No

Samsung Internet Android

Full support 6.0

pointermove event Chrome

Full support 55

Edge Full support 12


Full support 12


No support 12 — 79

Alternate Name'

Alternate Name' Uses the non-standard name: mspointermove

Firefox Full support 59


Full support 59


Full support 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 Full support 11


Full support 11


Full support 10

Alternate Name'

Alternate Name' Uses the non-standard name: mspointermove

Opera

?

Safari

No support No

WebView Android

Full support 55

Chrome Android

Full support 55

Firefox Android Full support 29

Disabled'

Full support 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 support No

Samsung Internet Android

Full support 6.0

pointerout event Chrome

Full support 55

Edge Full support 12


Full support 12


No support 12 — 79

Alternate Name'

Alternate Name' Uses the non-standard name: mspointerout

Firefox Full support 59


Full support 59


Full support 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 Full support 11


Full support 11


Full support 10

Alternate Name'

Alternate Name' Uses the non-standard name: mspointerout

Opera

?

Safari

No support No

WebView Android

Full support 55

Chrome Android

Full support 55

Firefox Android Full support 29

Disabled'

Full support 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 support No

Samsung Internet Android

Full support 6.0

pointerover event Chrome

Full support 55

Edge Full support 12


Full support 12


No support 12 — 79

Alternate Name'

Alternate Name' Uses the non-standard name: mspointerover

Firefox Full support 59


Full support 59


Full support 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 Full support 11


Full support 11


Full support 10

Alternate Name'

Alternate Name' Uses the non-standard name: mspointerover

Opera

?

Safari

No support No

WebView Android

Full support 55

Chrome Android

Full support 55

Firefox Android Full support 29

Disabled'

Full support 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 support No

Samsung Internet Android

Full support 6.0

pointerup event Chrome

Full support 55

Edge Full support 12


Full support 12


No support 12 — 79

Alternate Name'

Alternate Name' Uses the non-standard name: mspointerup

Firefox Full support 59


Full support 59


Full support 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 Full support 11


Full support 11


Full support 10

Alternate Name'

Alternate Name' Uses the non-standard name: mspointerup

Opera

?

Safari

No support No

WebView Android

Full support 55

Chrome Android

Full support 55

Firefox Android Full support 29

Disabled'

Full support 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 support No

Samsung Internet Android

Full support 6.0

spellcheck Chrome

Full support 43

Edge

Full support 12

Firefox

Full support 2

IE

?

Opera

Full support Yes

Safari

Full support 6

WebView Android

Full support 43

Chrome Android

Full support 43

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 4.0

style Chrome

Full support 45

Edge

Full support 12

Firefox

Full support 1

IE

Full support 8

Opera

Full support 8

Safari

Full support 11

WebView Android

Full support 45

Chrome Android

Full support 45

Firefox Android

Full support 4

Opera Android

Full support 10.1

Safari iOS

Full support 11

Samsung Internet Android

Full support 5.0

tabIndex Chrome

Full support 1

Edge Full support 18


Full support 18


Partial support 12

Notes'

Notes' Returns incorrect value for elements without an explicit tabindex attribute. See issue 4365703 for details.

Firefox

Full support 1

IE Partial support 8

Notes'

Partial support 8

Notes'

Notes' Returns incorrect value for elements without an explicit tabindex attribute. See issue 4365703 for details.

Opera

Full support Yes

Safari

Full support 6

WebView Android

Full support 4.4

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 1.0

title Chrome

Full support 1

Edge

Full support 12

Firefox

Full support 1

IE

?

Opera

Full support Yes

Safari

Full support 6

WebView Android

Full support 4.4

Chrome Android

Full support 18

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 1.0

transitioncancel event Chrome

Full support 74

Edge

Full support ≤79

Firefox

Full support 53

IE

?

Opera

Full support 62

Safari Full support 13.1


Full support 13.1


Full support 12

Disabled'

Disabled' From version 12: this feature is behind the Web Animations preference and the CSS Animations via Web Animations preference.

WebView Android

Full support 74

Chrome Android

Full support 74

Firefox Android

Full support 53

Opera Android

Full support 53

Safari iOS Full support 13.4


Full support 13.4


Full support 12

Disabled'

Disabled' From version 12: this feature is behind the Web Animations preference and the CSS Animations via Web Animations preference.

Samsung Internet Android

Full support 11.0

transitionend event

Chrome Full support 26


Full support 26


Full support 1

Alternate Name'

Alternate Name' Uses the non-standard name: webkitTransitionEnd

Edge Full support ≤79


Full support ≤79


Full support ≤79

Alternate Name'

Alternate Name' Uses the non-standard name: webkitTransitionEnd

Firefox

Full support 51

IE

Full support 10

Opera Full support 12.1


Full support 12.1


Full support 15

Alternate Name'

Alternate Name' Uses the non-standard name: webkitTransitionEnd No support 11.6 — 15

Alternate Name'

Alternate Name' Uses the non-standard name: oTransitionEnd

Safari Full support 6.1


Full support 6.1


Full support 4

Alternate Name'

Alternate Name' Uses the non-standard name: webkitTransitionEnd

WebView Android Full support ≤37


Full support ≤37


Full support 1

Alternate Name'

Alternate Name' Uses the non-standard name: webkitTransitionEnd

Chrome Android Full support 26


Full support 26


Full support 18

Alternate Name'

Alternate Name' Uses the non-standard name: webkitTransitionEnd

Firefox Android

Full support 51

Opera Android Full support 12.1


Full support 12.1


Full support 14

Alternate Name'

Alternate Name' Uses the non-standard name: webkitTransitionEnd No support 12 — 14

Alternate Name'

Alternate Name' Uses the non-standard name: oTransitionEnd

Safari iOS Full support 7


Full support 7


Full support 3.2

Alternate Name'

Alternate Name' Uses the non-standard name: webkitTransitionEnd

Samsung Internet Android Full support 1.5


Full support 1.5


Full support 1.0

Alternate Name'

Alternate Name' Uses the non-standard name: webkitTransitionEnd

transitionrun event Chrome

Full support 74

Edge

Full support ≤79

Firefox

Full support 53

IE

?

Opera

Full support 62

Safari Full support 13.1


Full support 13.1


Full support 12

Disabled'

Disabled' From version 12: this feature is behind the Web Animations preference and the CSS Animations via Web Animations preference.

WebView Android

Full support 74

Chrome Android

Full support 74

Firefox Android

Full support 53

Opera Android

Full support 53

Safari iOS Full support 13.4


Full support 13.4


Full support 12

Disabled'

Disabled' From version 12: this feature is behind the Web Animations preference and the CSS Animations via Web Animations preference.

Samsung Internet Android

Full support 11.0

transitionstart event Chrome

Full support 74

Edge

Full support ≤79

Firefox

Full support 53

IE

?

Opera

Full support 62

Safari Full support 13.1


Full support 13.1


Full support 12

Disabled'

Disabled' From version 12: this feature is behind the Web Animations preference and the CSS Animations via Web Animations preference.

WebView Android

Full support 74

Chrome Android

Full support 74

Firefox Android

Full support 53

Opera Android

Full support 53

Safari iOS Full support 13.4


Full support 13.4


Full support 12

Disabled'

Disabled' From version 12: this feature is behind the Web Animations preference and the CSS Animations via Web Animations preference.

Samsung Internet Android

Full support 11.0

translate

Experimental'

Chrome

Full support 19

Edge

Full support 79

Firefox

No support No

IE

No support No

Opera

No support No

Safari

Full support 6

WebView Android

Full support 4.4

Chrome Android

Full support 25

Firefox Android

Full support 4

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support 1.5

Legend

Full support  
Full support
Partial support  
Partial support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.'
Experimental. Expect behavior to change in the future.
Non-standard. Expect poor cross-browser support.'
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.'
Deprecated. Not for use in new websites.
See implementation notes.'
See implementation notes.
User must explicitly enable this feature.'
User must explicitly enable this feature.
Uses a non-standard name.'
Uses a non-standard name.


See also

References
;* HTML elements reference
Guides
;* [[../../../Learn/JavaScript/Client-side_web_APIs/Manipulating_documents|Manipulating documents]]: A beginner's guide to manipulating the DOM.