Document

The Document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree.

The DOM tree includes elements such as <body> and <table>, among many others. It provides functionality globally to the document, like how to obtain the page's URL and create new elements in the document.

The Document interface describes the common properties and methods for any kind of document. Depending on the document's type (e.g. HTML, XML, SVG, …), a larger API is available: HTML documents, served with the "text/html" content type, also implement the HTMLDocument interface, whereas XML and SVG documents implement the XMLDocument interface.

Constructor

Document()

Creates a new Document object.

Properties

This interface also inherits from the Node and EventTarget interfaces.

Document.activeElement Read only

Returns the Element that currently has focus.

Document.body

Returns the <body> or <frameset> node of the current document.

Document.characterSetRead only

Returns the character set being used by the document.

Document.childElementCount Read only

Returns the number of child elements of the current document.

Document.children Read only

Returns the child elements of the current document.

Document.compatMode Read only

Indicates whether the document is rendered in quirks or strict mode.

Document.contentType Read only

Returns the Content-Type from the MIME Header of the current document.

Document.doctypeRead only

Returns the Document Type Definition (DTD) of the current document.

Document.documentElementRead only

Returns the Element that is a direct child of the document. For HTML documents, this is normally the HTMLHtmlElement object representing the document's <html> element.

Document.documentURIRead only

Returns the document location as a string.

Document.embedsRead only

Returns a list of the embedded <embed> elements within the current document.

Document.firstElementChild Read only

Returns the first child element of the current document.

Document.fonts

Returns the FontFaceSet interface of the current document.

Document.formsRead only

Returns a list of the <form> elements within the current document.

Document.fullscreenElement Read only

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

Document.headRead only

Returns the <head> element of the current document.

Document.hiddenRead only

Returns a Boolean value indicating if the page is considered hidden or not.

Document.imagesRead only

Returns a list of the images in the current document.

Document.implementationRead only

Returns the DOM implementation associated with the current document.

Document.lastElementChild Read only

Returns the last child element of the current document.

Document.linksRead only

Returns a list of all the hyperlinks in the document.

Document.mozSyntheticDocument

Returns a Boolean that is true only if this document is synthetic, such as a standalone image, video, audio file, or the like.

Document.pictureInPictureElement Read only

Returns the Element currently being presented in picture-in-picture mode in this document.

Document.pictureInPictureEnabled Read only

Returns true if the picture-in-picture feature is enabled.

Document.pluginsRead only

Returns a list of the available plugins.

Document.pointerLockElement Read only

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.

Document.featurePolicy Read only

Returns the FeaturePolicy interface which provides a simple API for introspecting the feature policies applied to a specific document.

Document.scriptsRead only

Returns all the <script> elements on the document.

Document.scrollingElementRead only

Returns a reference to the Element that scrolls the document.

Document.styleSheets Read only

Returns a StyleSheetList of CSSStyleSheet objects for stylesheets explicitly linked into, or embedded in a document.

Document.timeline Read only

Returns timeline as a special instance of DocumentTimeline that is automatically created on page load.

Document.visibilityStateRead only

Returns a string denoting the visibility state of the document. Possible values are visible, hidden, prerender, and unloaded.

Extensions for HTMLDocument

The Document interface for HTML documents inherits from the HTMLDocument interface or, since HTML5, is extended for such documents.

Document.cookie

Returns a semicolon-separated list of the cookies for that document or sets a single cookie.

Document.defaultViewRead only

Returns a reference to the window object.

Document.designMode

Gets/sets the ability to edit the whole document.

Document.dir

Gets/sets directionality (rtl/ltr) of the document.

Document.domain

Gets/sets the domain of the current document.

Document.lastModifiedRead only

Returns the date on which the document was last modified.

Document.locationRead only

Returns the URI of the current document.

Document.readyStateRead only

Returns loading status of the document.

Document.referrerRead only

Returns the URI of the page that linked to this page.

Document.title

Sets or gets the title of the current document.

Document.URLRead only

Returns the document location as a string.

Event handlers

The Document interface is extended with additional event handlers defined in GlobalEventHandlers.

Document.onafterscriptexecute

Represents the event handling code for the afterscriptexecute event.

Document.onbeforescriptexecute

Represents the event handling code for the beforescriptexecute event.

Document.oncopy

Represents the event handling code for the copy event.

Document.oncut

Represents the event handling code for the cut event.

Document.onfullscreenchange

Is an event handler representing the code to be called when the fullscreenchange event is raised.

Document.onfullscreenerror

Is an event handler representing the code to be called when the fullscreenerror event is raised.

Document.onpaste

Represents the event handling code for the paste event.

Document.onreadystatechange

Represents the event handling code for the readystatechange event.

GlobalEventHandlers.onselectionchange

Is an event handler representing the code to be called when the selectionchange event is raised.

Document.onvisibilitychange

Is an event handler representing the code to be called when the visibilitychange event is raised.

Deprecated properties

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.anchors Read only

Returns a list of all of the anchors in the document.

Document.applets Read only

Returns an ordered list of the applets within a document.

Document.bgColor

Gets/sets the background color of the current document.

Document.charset Read only

Alias of Document.characterSet. Use this property instead.

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 Read only

Alias of Document.characterSet. Use this property instead.

Document.lastStyleSheetSet Read only

Returns the name of the style sheet set that was last enabled. Has the value null until the style sheet is changed by setting the value of selectedStyleSheetSet.

Document.linkColor

Gets/sets the color of hyperlinks in the document.

Document.preferredStyleSheetSet Read only

Returns the preferred style sheet set as specified by the page author.

Document.rootElement

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

Document.selectedStyleSheetSet

Returns which style sheet set is currently in use.

Document.styleSheetSets Read only

Returns a list of the style sheet sets available on the document.

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

Returns 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

Returns the version number as specified in the XML declaration or "1.0" if the declaration is absent.

Methods

This interface also inherits from the Node and EventTarget interfaces.

Document.adoptNode()

Adopt node from an external document.

Document.append()

Inserts a set of Node objects or DOMString objects after the last child of the document.

Document.captureEvents()

See Window.captureEvents.

Document.caretPositionFromPoint()

Returns a CaretPosition object containing the DOM node containing the caret, and caret's character offset within that node.

Document.caretRangeFromPoint()

Gets a Range object for the document fragment under the specified coordinates.

Document.createAttribute()

Creates a new Attr object and returns it.

Document.createAttributeNS()

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

Document.createCDATASection()

Creates a new CDATA node and returns it.

Document.createComment()

Creates a new comment node and returns it.

Document.createDocumentFragment()

Creates a new document fragment.

Document.createElement()

Creates a new element with the given tag name.

Document.createElementNS()

Creates a new element with the given tag name and namespace URI.

Document.createEntityReference()

Creates a new entity reference object and returns it.

Document.createEvent()

Creates an event object.

Document.createNodeIterator()

Creates a NodeIterator object.

Document.createProcessingInstruction()

Creates a new ProcessingInstruction object.

Document.createRange()

Creates a Range object.

Document.createTextNode()

Creates a text node.

Document.createTouch()

Creates a Touch object.

Document.createTouchList()

Creates a TouchList object.

Document.createTreeWalker()

Creates a TreeWalker object.

Document.elementFromPoint()

Returns the topmost element at the specified coordinates.

Document.elementsFromPoint()

Returns an array of all elements at the specified coordinates.

Document.enableStyleSheetsForSet()

Enables the style sheets for the specified style sheet set.

Document.exitPictureInPicture()

Remove the video from the floating picture-in-picture window back to its original container.

Document.exitPointerLock()

Release the pointer lock.

Document.getAnimations()

Returns an array of all Animation objects currently in effect, whose target elements are descendants of the document.

Document.getBoxQuads()

Returns a list of DOMQuad objects representing the CSS fragments of the node.

Document.getElementById

Returns an object reference to the identified element.

Document.getElementsByClassName()

Returns a list of elements with the given class name.

Document.getElementsByTagName()

Returns a list of elements with the given tag name.

Document.getElementsByTagNameNS()

Returns a list of elements with the given tag name and namespace.

Document.getSelection()

Returns a Selection object representing the range of text selected by the user, or the current position of the caret.

Document.hasStorageAccess()

Returns a Promise that resolves with a boolean value indicating whether the document has access to its first-party storage.

Document.importNode()

Returns a clone of a node from an external document.

Document.normalizeDocument()

Replaces entities, normalizes text nodes, etc.

Document.prepend()

Inserts a set of Node objects or DOMString objects before the first child of the document.

Document.querySelector()

Returns the first Element node within the document, in document order, that matches the specified selectors.

Document.querySelectorAll()

Returns a list of all the Element nodes within the document that match the specified selectors.

Document.releaseCapture()

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

Document.releaseEvents()

See Window.releaseEvents().

Document.replaceChildren()

Replaces the existing children of a document with a specified new set of children.

Document.requestStorageAccess()

Returns a Promise that resolves if the access to first-party storage was granted, and rejects if access was denied.

Document.mozSetImageElement()

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

The Document interface is extended with the XPathEvaluator interface:

Document.createExpression()

Compiles an XPathExpression which can then be used for (repeated) evaluations.

Document.createNSResolver()

Creates an XPathNSResolver object.

Document.evaluate()

Evaluates an XPath expression.

Extension for HTML documents

The Document interface for HTML documents inherit from the HTMLDocument interface or, since HTML5, is extended for such documents:

Document.clear()

In majority of modern browsers, including recent versions of Firefox and Internet Explorer, this method does nothing.

Document.close()

Closes a document stream for writing.

Document.execCommand()

On an editable document, executes a formatting command.

Document.getElementsByName()

Returns a list of elements with the given name.

Document.hasFocus()

Returns true if the focus is currently located anywhere inside the specified document.

Document.open()

Opens a document stream for writing.

Document.queryCommandEnabled()

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

Document.queryCommandIndeterm()

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

Document.queryCommandState()

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

Document.queryCommandSupported()

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

Document.queryCommandValue()

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

Document.write()

Writes text in a document.

Document.writeln()

Writes a line of text in a document.

Events

Listen to these events using addEventListener() or by assigning an event listener to the oneventname property of this interface.

scroll

Fired when the document view or an element has been scrolled. Also available via the onscroll property.

visibilitychange

Fired when the content of a tab has become visible or has been hidden. Also available via the onvisibilitychange property.

wheel

Fired when the user rotates a wheel button on a pointing device (typically a mouse). Also available via the onwheel property.

Animation events

animationcancel

Fired when an animation unexpectedly aborts. Also available via the onanimationcancel property.

animationend

Fired when an animation has completed normally. Also available via the onanimationend property.

animationiteration

Fired when an animation iteration has completed. Also available via the onanimationiteration property.

animationstart

Fired when an animation starts. Also available via the onanimationstart property.

Clipboard events

copy

Fired when the user initiates a copy action through the browser's user interface. Also available via the oncopy property.

cut

Fired when the user initiates a cut action through the browser's user interface. Also available via the oncut property.

paste

Fired when the user initiates a paste action through the browser's user interface. Also available via the onpaste property.

Drag & drop events

drag

Fired every few hundred milliseconds as an element or text selection is being dragged by the user. Also available via the ondrag property.

dragend

Fired when a drag operation is being ended (by releasing a mouse button or hitting the escape key). Also available via the ondragend property.

dragenter

Fired when a dragged element or text selection enters a valid drop target. Also available via the ondragenter property.

dragleave

Fired when a dragged element or text selection leaves a valid drop target. Also available via the ondragleave property.

dragover

Fired when an element or text selection is being dragged over a valid drop target (every few hundred milliseconds). Also available via the ondragover property.

dragstart

Fired when the user starts dragging an element or text selection. Also available via the ondragstart property.

drop

Fired when an element or text selection is dropped on a valid drop target. Also available via the ondrop property.

Fullscreen events

fullscreenchange

Fired when the Document transitions into or out of full-screen mode. Also available via the onfullscreenchange property.

fullscreenerror

Fired if an error occurs while attempting to switch into or out of full-screen mode. Also available via the onfullscreenerror property.

Keyboard events

keydown

Fired when a key is pressed. Also available via the onkeydown property.

keypress

Fired when a key that produces a character value is pressed down. Also available via the onkeypress property.

keyup

Fired when a key is released. Also available via the onkeyup property.

Load & unload events

DOMContentLoaded

Fired when the document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.

readystatechange

Fired when the readyState attribute of a document has changed. Also available via the onreadystatechange property.

Pointer events

gotpointercapture

Fired when an element captures a pointer using setPointerCapture(). Also available via the ongotpointercapture property.

lostpointercapture

Fired when a captured pointer is released. Also available via the onlostpointercapture property.

pointercancel

Fired when a pointer event is canceled. Also available via the onpointercancel property.

pointerdown

Fired when a pointer becomes active. Also available via the onpointerdown property.

pointerenter

Fired when a pointer is moved into the hit test boundaries of an element or one of its descendants. Also available via the onpointerenter property.

pointerleave

Fired when a pointer is moved out of the hit test boundaries of an element. Also available via the onpointerleave property.

pointerlockchange

Fired when the pointer is locked/unlocked. Also available via the onpointerlockchange property.

pointerlockerror

Fired when locking the pointer failed. Also available via the onpointerlockerror property.

pointermove

Fired when a pointer changes coordinates. Also available via the onpointermove property.

pointerout

Fired when a pointer is moved out of the hit test boundaries of an element (among other reasons). Also available via the onpointerout property.

pointerover

Fired when a pointer is moved into an element's hit test boundaries. Also available via the onpointerover property.

pointerup

Fired when a pointer is no longer active. Also available via the onpointerup property.

Selection events

selectionchange

Fired when the current text selection on a document is changed. Also available via the onselectionchange property.

selectstart

Fired when the user begins a new selection. Also available via the onselectstart property.

Touch events

touchcancel

Fired when one or more touch points have been disrupted in an implementation-specific manner (for example, too many touch points are created). Also available via the ontouchcancel property.

touchend

Fired when one or more touch points are removed from the touch surface. Also available via the ontouchend property

touchmove

Fired when one or more touch points are moved along the touch surface. Also available via the ontouchmove property

touchstart

Fired when one or more touch points are placed on the touch surface. Also available via the ontouchstart property

Transition events

transitioncancel

Fired when a CSS transition is canceled. Also available via the ontransitioncancel property.

transitionend

Fired when a CSS transition has completed. Also available via the ontransitionend property.

transitionrun

Fired when a CSS transition is first created. Also available via the ontransitionrun property.

transitionstart

Fired when a CSS transition has actually started. Also available via the ontransitionstart property.

Non-standard extensions

Non-standard: This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Firefox notes

Firefox defines some non-standard methods:

Document.execCommandShowHelp()

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()

Use the Element.getBoundingClientRect() method instead.

Document.loadOverlay()

Loads a XUL overlay dynamically. This only works in XUL documents.

Document.queryCommandText()

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

Internet Explorer notes

Microsoft defines some non-standard properties:

Document.fileSize*

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

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
Document
1
12
1
4
3
1
1
18
4
10.1
1
1.0
Document
60
17
20
No
47
8
60
60
20
44
8
8.0
DOMContentLoaded_event
1
12
1
9
9
3.1
1
18
4
10.1
2
1.0
URL
1
12
1
4
3
1
1
18
4
10.1
1
1.0
adoptNode
1
12
1
9
≤12.1
3
1
18
4
≤12.1
1
1.0
alinkColor
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
4
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
11
1.2-11
Only supported for HTMLDocument, not all Document objects.
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
all
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
24
4
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
11
3-11
Only supported for HTMLDocument, not all Document objects.
64
≤37-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
24
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
anchors
1
12
1
4
≤12.1
1
1
18
4
≤12.1
1
1.0
animationcancel_event
No
No
54
No
No
13.1
12
No
No
54
No
13.4
12
No
animationend_event
43
12
6
10
30
9
43
43
6
30
9
4.0
animationiteration_event
43
12
6
10
30
9
43
43
6
30
9
4.0
animationstart_event
43
12
6
10
30
9
43
43
6
30
9
4.0
applets
1
12
1
4
≤12.1
1
1
18
4
≤12.1
1
1.0
bgColor
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
4
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
body
1
12
60
1-60
Only supported for HTMLDocument, not all Document objects.
4
9.6
1
1
18
60
4-60
Only supported for HTMLDocument, not all Document objects.
10.1
1
1.0
captureEvents
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
11
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
caretPositionFromPoint
No
No
20
No
No
No
No
No
20
No
No
No
caretRangeFromPoint
4
12
No
No
15
5
≤37
18
No
14
4
1.0
characterSet
1
1
charset alias was made read-only in Chrome 45.
1
12
12
12
1
44
1.5
9
4
9
≤12.1
No
No
3
3
3
1
1
charset alias was made read-only in WebView 45.
1
18
18
charset alias was made read-only in Chrome 45.
18
4
44
4
Yes
No
No
1
1
1
1.0
1.0
charset alias was made read-only in Samsung Internet 5.0.
1.0
clear
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
4
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
1
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
1
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
close
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
4
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
compatMode
1
12
1
6
≤12.1
3.1
1
18
4
≤12.1
2
1.0
contentType
36
17
1
No
23
≤12.1-15
9
37
36
4
24
≤12.1-14
9
3.0
cookie
1
12
1
Before Firefox 68, cookie was available only on HTML documents; it is now available on all documents, such as XML and SVG.
4
3
1
1
18
4
Before Firefox 68, cookie was available only on HTML documents; it is now available on all documents, such as XML and SVG.
10.1
1
1.0
copy_event
1
≤18
6
No
15
3
1
18
6
14
3
1.0
createAttribute
1
12
44
1-44
The parameter was not converted to its lowercase variant.
6
≤12.1
1
1
18
44
4-44
The parameter was not converted to its lowercase variant.
≤12.1
1
1.0
createAttributeNS
1
12
1
9
≤12.1
1
1
18
4
≤12.1
1
1.0
createCDATASection
1
12
1
9
≤12.1
1
1
18
4
≤12.1
1
1.0
createComment
1
12
1
6
≤12.1
1
1
18
4
≤12.1
1
1.0
createDocumentFragment
1
12
1
6
≤12.1
1
1
18
4
≤12.1
1
1.0
createElement
1
12
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.
5
6
1
1
18
4
10.1
1
1.0
createElementNS
1
12
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.
9
≤12.1
1
1
18
4
≤12.1
1
1.0
createEntityReference
1-29
No
1-7
No
15-16
1-10
1-≤37
18-29
4-7
14-16
1-10
1.0-2.0
createEvent
1
12
1
From version 67, creating touch events using this method is no longer supported.
9
7
1
1
18
4
10.1
1
1.0
createExpression
1
12
1
No
≤12.1
3
≤37
18
4
≤12.1
1
1.0
createNodeIterator
1
12
1
9
9
3
1
18
4
Yes
1
1.0
createNSResolver
1
12
1
No
≤12.1
3
≤37
18
4
≤12.1
1
1.0
createProcessingInstruction
1
12
1
9
≤12.1
1
1
18
4
≤12.1
1
1.0
createRange
1
12
1
9
≤12.1
1
1
18
4
≤12.1
1
1.0
createTextNode
1
12
1
5
7
1
1
18
4
10.1
1
1.0
createTouch
No
No
18-67
No
No
No
≤37-68
Since WebView 55, all parameters are optional.
25-68
Since Chrome 55, all parameters are optional.
6
14-48
Since Opera Android 42, all parameters are optional.
≤3
1.5-10.0
Since Samsung Internet 6.0, all parameters are optional.
createTouchList
22-69
No
18-67
No
Yes-56
No
≤37-69
25-69
6
Yes-48
≤3
1.5-10.0
createTreeWalker
1
12
1
9
9
3
1
18
4
10.1
3
1.0
currentScript
29
12
4
No
16
8
≤37
29
4
16
8
2.0
cut_event
1
≤18
6
No
15
3
1
18
6
14
3
1.0
defaultView
1
12
1
9
≤12.1
1
1
18
4
≤12.1
1
1.0
designMode
1
12
1
4
9
1.2
1
18
4
10.1
1
1.0
dir
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
Incorrect behavior before Firefox 23.
5
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
10.1
1-10.1
Only supported for HTMLDocument, not all Document objects.
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
Incorrect behavior before Firefox 23.
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
10.3
1-10.3
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
doctype
1
12
1
6
≤12.1
1
1
18
4
≤12.1
1
1.0
documentElement
1
12
1
5
7
1
1
18
4
10.1
1
1.0
documentURI
1
17
1
No
≤12.1
3
1
18
4
≤12.1
1
1.0
domain
1
12
1
From Firefox 62, if the domain cannot be identified, domain returns an empty string instead of null. See bug 819475.
4
≤12.1
1
1
18
4
From Firefox 62, if the domain cannot be identified, domain returns an empty string instead of null. See bug 819475.
≤12.1
1
1.0
drag_event
4
12
3.5
Firefox doesn't set the mouse coordinates during the drag event. See bug 505521.
10
12
3.1
No
No
No
No
11
No
dragend_event
4
Before 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 for more details.
12
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). See bug 460801 for details."]
10
12
3.1
No
No
No
No
11
No
dragenter_event
4
12
3.5
In Firefox, the dragenter event is fired twice when the dropzone is parent of draggable or draggable itself. See bug 804036 for details.
10
12
3.1
No
No
No
No
11
No
dragexit_event
No
12-79
3.5
10
12
3.1
No
No
No
No
No
No
dragleave_event
4
12
3.5
10
12
3.1
No
No
No
No
11
No
dragover_event
4
12
3.5
10
12
3.1
No
No
No
No
11
No
dragstart_event
4
12
3.5
10
12
3.1
No
No
No
No
11
No
drop_event
4
12
3.5
10
12
3.1
No
No
No
No
11
No
embeds
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
4
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
10.1
2-10.1
Only supported for HTMLDocument, not all Document objects.
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
10.3
1-10.3
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
enableStyleSheetsForSet
No
No
3
No
No
No
No
No
4
No
No
No
evaluate
1
12
1
No
9
3
≤37
18
4
10.1
1
1.0
execCommand
1
12
1
["From Firefox 82, nested calls are not supported (return false). See bug 1634262.", "Before Firefox 89, manipulating the content of <input> and <textarea> elements using Document.execCommand() commands requires workarounds (see bug 1220696)."]
4
9
1.3
1
18
4
["From Firefox 82, nested calls are not supported (return false). See bug 1634262.", "Before Firefox 89, manipulating the content of <input> and <textarea> elements using Document.execCommand() commands requires workarounds (see bug 1220696)."]
10.1
1
1.0
execCommandShowHelp
No
12-79
1-14
This method never did anything and always threw an exception.
4
No
No
No
No
4-14
This method never did anything and always threw an exception.
No
No
No
exitFullscreen
71
15
79
12
12-14
64
9
11
58
15
12.1-15
5.1
71
≤37
71
18
64
9
50
14
12.1-14
12
Only available on iPad, not on iPhone.
10.0
1.0
exitPictureInPicture
69
79
No
No
56
13.1
No
No
No
No
13.4
No
exitPointerLock
37
22
13
50
14-50
No
24
15
10.1
37
≤37
37
25
50
14-50
24
14
10.3
3.0
1.5
featurePolicy
74
79
69
65-69
No
62
No
74
74
65
53
No
11.0
fgColor
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
4
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
fileSize
No
No
No
5.5-11
No
No
No
No
No
No
No
No
fonts
35
79
41
No
22
10
≤37
35
41
22
10
3.0
forms
1
12
1
4
≤12.1
1
1
18
4
≤12.1
1
1.0
fragmentDirective
86
86
No
No
72
No
86
86
No
61
No
14.0
fullscreen
71
15
79
12
64
9
No
58
15
6
71
≤37
71
18
64
9
50
14
12
Only available on iPad, not on iPhone.
10.0
1.0
fullscreenchange_event
71
15
79
12
12-14
64
10
11
58
15
12.1-15
5.1
71
≤37
71
18
64
10
50
14
12.1-14
12
Only available on iPad, not on iPhone.
10.0
1.0
fullscreenEnabled
71
20
12
64
10
11
58
15
12.1-15
6
71
Yes
71
25
64
10
50
14
12.1-14
12
Only available on iPad, not on iPhone.
10.0
1.5
fullscreenerror_event
71
18
79
12
12-14
64
10
11
58
15
12.1-15
6
71
≤37
71
18
64
10
50
14
12.1-14
12
Only available on iPad, not on iPhone.
10.0
1.0
getBoxObjectFor
No
No
1-3.6
No
No
No
No
No
No
No
No
No
getElementById
1
12
1
5.5
7
1
1
18
4
10.1
1
1.0
getElementsByClassName
1
12
3
9
9.5
3.1
1
18
4
10.1
2
1.0
getElementsByName
1
12
Before Edge 79, this method returns an HTMLCollection, not a NodeList.
1
5
Returns an HTMLCollection, not a NodeList
5
1
1
18
4
10.1
1
1.0
getElementsByTagName
1
12
1
5
5.1
1
1
18
4
10.1
1
1.0
getElementsByTagNameNS
1
12
1
9
≤12.1
1
1
18
4
≤12.1
1
1.0
getSelection
1
12
1
9
≤12.1
4
≤37
18
4
≤12.1
3.2
1.0
gotpointercapture_event
57
17
59
No
44
13
57
57
79
43
13
7.0
hasFocus
1
12
3
5.5
15
4
≤37
18
4
14
3.2
1.0
hasStorageAccess
78
85
65
No
65
11.1
No
78
65
No
11.3
No
head
4
12
4
9
11
5
≤37
Yes
4
Yes
4
Yes
height
1-31
No
1-6
No
15-18
1-10
1-4.4.3
18-31
4-6
14-18
1-10
1.0-3.0
hidden
33
13
12
18
Since Firefox 56 it also returns true on Mac when the window is completely hidden by another non-translucent application.
10-52
10
12.1
7
4.4.3
≤37
33
Yes
18
Since Firefox 56 it also returns true on Mac when the window is completely hidden by another non-translucent application.
10-52
12.1
7
2.0
1.0
images
1
12
1
4
≤12.1
1
1
18
4
≤12.1
1
1.0
implementation
1
12
1
6
≤12.1
1
1
18
4
≤12.1
1
1.0
importNode
1
12
1
9
9
1
1
18
4
10.1
1
1.0
keydown_event
1
12
14
9
11.6
2
1
18
14
12
1
1.0
keypress_event
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.
12
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).
9
11.6
2
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.
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.
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).
12
1
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
1
12
14
9
11.6
2
1
18
14
12
1
1.0
lastModified
1
12
1
4
≤12.1
1
1
18
4
≤12.1
1
1.0
lastStyleSheetSet
No
No
3
No
No
No
No
No
4
No
No
No
linkColor
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
4
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
links
1
12
1
4
≤12.1
1
1
18
4
≤12.1
1
1.0
location
1
12
1
4
3
1
1
18
4
10.1
1
1.0
lostpointercapture_event
57
17
59
No
44
13
57
57
79
43
13
7.0
mozSetImageElement
No
No
4
No
No
No
No
No
4
No
No
No
mozSyntheticDocument
No
No
8-23
No
No
No
No
No
8-23
No
No
No
normalizeDocument
No
No
1-7
No
No
No
No
No
4-7
No
No
No
onafterscriptexecute
No
No
9
No
No
No
No
No
9
No
No
No
onbeforescriptexecute
No
No
9
No
No
No
No
No
9
No
No
No
oncopy
1
17
6
No
≤12.1
2
1
18
6
≤12.1
1
1.0
oncut
1
17
6
No
≤12.1
2
1
18
6
≤12.1
1
1.0
onfreeze
68
79
No
No
55
No
68
68
No
48
No
10.0
onfullscreenchange
71
15
79
12
12-14
64
10
11
58
15
12.1-15
5.1
71
≤37
71
18
64
10
50
14
12.1-14
12
Only available on iPad, not on iPhone.
10.0
1.0
onfullscreenerror
71
18
79
12
12-14
64
10
11
58
15
12.1-15
6
71
≤37
71
18
64
10
50
14
12.1-14
12
Only available on iPad, not on iPhone.
10.0
1.0
onpaste
1
17
6
No
≤12.1
2
1
18
6
≤12.1
1
1.0
onpointerlockchange
36
13
50
14-50
No
23
10.1
37
36
50
14-50
24
No
3.0
onpointerlockerror
36
13
50
14-50
No
23
10.1
37
36
50
14-50
24
No
3.0
onreadystatechange
9
12
9
4
≤12.1
5.1
≤37
18
9
≤12.1
5
1.0
onresume
68
79
No
No
55
No
68
68
No
48
No
10.0
onvisibilitychange
62
Before Chrome 62, this event handler attribute is not supported; however, the event itself is supported since Chrome 33. The event can be listened to via document.addEventListener('visibilitychange', function() {});.
18
Before Edge 18, this event handler attribute was not supported; however, the event itself was supported since Edge 12. The event can be listened to via document.addEventListener('visibilitychange', function() {});.
56
No
This event handler attribute is not supported; however, the event itself is supported since IE 10. The event can be listened to via document.addEventListener('visibilitychange', function() {});.
49
Before Opera 49, this event handler attribute is not supported; however, the event itself is supported since Opera 20. The event can be listened to via document.addEventListener('visibilitychange', function() {});.
10.1
["Doesn't fire the visibilitychange event when navigating away from a document, so also include code to check for the pagehide event (which does fire for that case in all current browsers). See WebKit bugs 116769, 151234, 151610, and 194897.", "Before Safari 10.1, this event handler attribute was not supported; however, the event itself was supported since Safari 7. The event can be listened to via document.addEventListener('visibilitychange', function() {});."]
62
Before WebView 62, this event handler attribute is not supported; however, the event itself is supported since WebView 4.4.3. The event can be listened to via document.addEventListener('visibilitychange', function() {});.
62
Before Chrome 62, this event handler attribute is not supported; however, the event itself is supported since Chrome 33. The event can be listened to via document.addEventListener('visibilitychange', function() {});.
56
46
Before Opera Android 46, this event handler attribute is not supported; however, the event itself is supported since Opera Android 20. The event can be listened to via document.addEventListener('visibilitychange', function() {});.
10.3
["Doesn't fire the visibilitychange event when navigating away from a document, so also include code to check for the pagehide event (which does fire for that case in all current browsers). See WebKit bugs 116769, 151234, 151610, and 194897.", "Before Safari iOS 10.3, this event handler attribute was not supported; however, the event itself was supported since Safari iOS 7. The event can be listened to via document.addEventListener('visibilitychange', function() {});."]
8.0
Before Samsung Internet 8.0, this event handler attribute is not supported; however, the event itself is supported since Samsung Internet 2.0. The event can be listened to via document.addEventListener('visibilitychange', function() {});.
open
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
4
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
origin
41-71
12-79
No
No
28-58
7-14
41-71
41-71
No
28-50
7-14
4.0-10.0
paste_event
1
12
6
11
15
3
1
18
6
14
3
1.0
pictureInPictureEnabled
69
79
No
No
56
13.1
No
No
No
No
13.4
No
plugins
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
4
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
10.1
3-10.1
Only supported for HTMLDocument, not all Document objects.
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
10.3
1-10.3
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
pointercancel_event
55
12
12-79
59
29
11
10
42
13
55
55
79
29
42
13
6.0
pointerdown_event
55
12
12-79
59
29
11
10
42
13
55
55
79
29
42
13
6.0
pointerenter_event
55
12
12-79
59
29
11
10
42
13
55
55
79
29
42
13
6.0
pointerleave_event
55
12
12-79
59
29
11
10
42
13
55
55
79
29
42
13
6.0
pointerlockchange_event
45
22-45
≤79
50
14-50
?
?
10.1
45
≤37-45
45
25-45
50
14-50
?
No
5.0
1.5-5.0
pointerlockerror_event
45
22-45
≤79
50
14-50
?
?
10.1
45
≤37-45
45
25-45
50
14-50
?
No
5.0
1.5-5.0
pointermove_event
55
12
12-79
59
29
11
10
42
13
55
55
79
29
42
13
6.0
pointerout_event
55
12
12-79
59
29
11
10
42
13
55
55
79
29
42
13
6.0
pointerover_event
55
12
12-79
59
29
11
10
42
13
55
55
79
29
42
13
6.0
pointerrawupdate_event
77
79
No
No
64
No
77
77
No
55
No
12.0
pointerup_event
55
12
12-79
59
29
11
10
42
13
55
55
79
29
42
13
6.0
preferredStyleSheetSet
No
No
3
No
No
No
No
No
4
No
No
No
queryCommandEnabled
1
12
41
1-41
queryCommandEnabled with arguments cut, copy or paste would throw errors unless the script had special privileges.
4
≤12.1
2
1
18
41
4-41
queryCommandEnabled with arguments cut, copy or paste would throw errors unless the script had special privileges.
≤12.1
1
1.0
queryCommandIndeterm
1
12
1
4
15
2
1
18
4
14
1
1.0
queryCommandState
1
12
1
4
≤12.1
2
1
18
4
≤12.1
1
1.0
queryCommandSupported
1
12
41
1-41
paste argument incorrectly returned true when the paste feature was available but the calling script had insufficient privileges to actually perform the action.
4
≤12.1
2
1
18
41
4-41
paste argument incorrectly returned true when the paste feature was available but the calling script had insufficient privileges to actually perform the action.
≤12.1
1
1.0
queryCommandText
No
12-79
1-14
This method never did anything and always threw an exception.
4
No
No
No
No
4-14
This method never did anything and always threw an exception.
No
No
No
queryCommandValue
1
12
1
4
≤12.1
2
1
18
4
≤12.1
1
1.0
readyState
1
12
3.6
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.
4-9
Only supports 'complete'.
11
Opera Presto fires 'complete' late after the 'load' event (in an incorrect order as per HTML5 standard specification).
1
1
18
4
11
Opera Presto fires 'complete' late after the 'load' event (in an incorrect order as per HTML5 standard specification).
1
1.0
readystatechange_event
1
12
4
4
≤12.1
≤4
≤37
18
4
≤12.1
≤3
1.0
referrer
1
12
1
4
3
1
1
18
4
10.1
1
1.0
registerElement
33-80
79-80
31-59
No
23-67
No
4.4.3-80
33-80
31-59
24-57
No
3.0-13.0
releaseCapture
No
No
4
5
No
No
No
No
4
No
No
No
releaseEvents
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
11
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
requestStorageAccess
78
85
65
No
65
11.1
No
78
65
No
11.3
No
rootElement
34
12
52
9
21
10.1
37
34
52
21
10.3
2.0
routeEvent
No
No
1-25
No
No
No
No
No
4-25
No
No
No
scripts
1
12
9
4
≤12.1
3
1
18
9
≤12.1
1
1.0
scroll_event
1
12
6
9
11.6
2
1
18
6
12
1
1.0
scrollingElement
44
12
48
No
31
9
44
44
48
32
9
4.0
selectedStyleSheetSet
No
No
3
No
No
No
No
No
4
No
No
No
selectionchange_event
11
12
52
5.5
15
5.1
≤37
18
52
14
5
1.0
selectstart_event
1
12
52
4
15
1.3
1
18
52
14
No
1.0
styleSheetSets
No
No
3
No
No
No
No
No
4
No
No
No
timeline
84
84
75
No
70
13.1
84
84
79
63-79
60
13.4
14.0
title
1
12
1
4
≤12.1
1
1
18
4
≤12.1
1
1.0
touchcancel_event
22
12
52
No
No
No
≤37
25
6
Yes
Yes
1.5
touchend_event
22
12
52
No
No
No
≤37
25
6
Yes
Yes
1.5
touchmove_event
22
12
52
No
No
No
≤37
25
6
Yes
Yes
1.5
touchstart_event
22
12
52
No
No
No
≤37
25
6
Yes
Yes
1.5
transitioncancel_event
No
No
53
No
?
13.1
12
No
No
53
?
13.4
12
No
transitionend_event
No
12
51
10
The ontransitionend attribute is not supported in IE. To listen to this event, use document.addEventListener('transitionend', function() {});.
?
11
No
No
51
?
11
No
transitionrun_event
No
12
53
10
The ontransitionrun attribute is not supported in IE. To listen to this event, use document.addEventListener('transitionrun', function() {});.
?
13.1
12
No
No
53
?
13.4
12
No
transitionstart_event
No
12
53
10
The ontransitionstart attribute is not supported in IE. To listen to this event, use document.addEventListener('transitionstart', function() {});.
?
13.1
12
No
No
53
?
13.4
12
No
visibilitychange_event
33
Before Chrome 62, the onvisibilitychange attribute is not supported. To listen to this event in earlier versions of Chrome, use document.addEventListener('visibilitychange', function() {});.
13
12
Before Edge 18, the onvisibilitychange attribute is not supported. To listen to this event in earlier versions of Edge, use document.addEventListener('visibilitychange', function() {});.
56
10
The onvisibilitychange attribute is not supported in IE. To listen to this event, use document.addEventListener('visibilitychange', function() {});.
20
Before Opera 49, the onvisibilitychange attribute is not supported. To listen to this event in earlier versions of Opera, use document.addEventListener('visibilitychange', function() {});.
15
12.1-15
7
["Doesn't fire the visibilitychange event when navigating away from a document, so also include code to check for the pagehide event (which does fire for that case in all current browsers). See WebKit bugs 116769, 151234, 151610, and 194897.", "Before Safari 14, the event does not bubble, so document.addEventListener('visibilitychange', ...) works, but window.addEventListener('visibilitychange', ...) does not.", "Before Safari 10.1, the onvisibilitychange attribute is not supported. To listen to this event in earlier versions of Safari, use document.addEventListener('visibilitychange', function() {});."]
4.4.3
Before WebView 62, the onvisibilitychange attribute is not supported. To listen to this event in earlier versions of WebView, use document.addEventListener('visibilitychange', function() {});.
≤37
33
Before Chrome 62, the onvisibilitychange attribute is not supported. To listen to this event in earlier versions of Chrome, use document.addEventListener('visibilitychange', function() {});.
18
56
20
Before Opera Android 46, the onvisibilitychange attribute is not supported. To listen to this event in earlier versions of Opera Android, use document.addEventListener('visibilitychange', function() {});.
14
12.1-14
7
["Doesn't fire the visibilitychange event when navigating away from a document, so also include code to check for the pagehide event (which does fire for that case in all current browsers). See WebKit bugs 116769, 151234, 151610, and 194897.", "Before Safari iOS 14, the event does not bubble, so document.addEventListener('visibilitychange', ...) works, but window.addEventListener('visibilitychange', ...) does not.", "Before Safari iOS 10.3, the onvisibilitychange attribute is not supported. To listen to this event in earlier versions of Safari iOS, use document.addEventListener('visibilitychange', function() {});."]
2.0
Before Samsung Internet 8.0, the onvisibilitychange attribute is not supported. To listen to this event in earlier versions of Samsung Internet, use document.addEventListener('visibilitychange', function() {});.
1.0
visibilityState
33
13
12
18
10-52
10
20
15
12.1-15
7
4.4.3
≤37
33
18
18
10-52
20
14
12.1-14
7
2.0
1.0
vlinkColor
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
4
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
wasDiscarded
68
79
No
No
55
No
68
68
No
48
No
10.0
wheel_event
61
12
17
Yes
48
7
61
61
17
45
No
8.0
width
1-31
No
1-6
No
15-18
1-10
1-4.4.3
18-31
4-6
14-18
1-10
1.0-3.0
write
1
12
1
4
3
1
1
18
4
10.1
1
1.0
writeln
64
1-64
Only supported for HTMLDocument, not all Document objects.
12
1
4
51
≤12.1-51
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
64
1-64
Only supported for HTMLDocument, not all Document objects.
64
18-64
Only supported for HTMLDocument, not all Document objects.
4
47
≤12.1-47
Only supported for HTMLDocument, not all Document objects.
11
1-11
Only supported for HTMLDocument, not all Document objects.
9.0
1.0-9.0
Only supported for HTMLDocument, not all Document objects.
xmlEncoding
1
12
1-10
9
15
3
1
18
4-10
14
1
1.0
xmlStandalone
1
12
1-10
9
15
3
1
18
4-10
14
1
1.0
xmlVersion
1
12
1-10
9
15
3
1
18
4-10
14
1
1.0
activeElement
1
12
3
6
≤12.1
4
≤37
18
4
≤12.1
3.2
1.0
adoptedStyleSheets
73
79
No
No
60
No
73
73
No
50
No
11.0
elementFromPoint
1
Before Chrome 66, this method returned null when the element was a child of a host node. See issue 759947.
12
3
4
≤12.1
Before Opera 53, this method returned null when the element was a child of a host node. See issue 759947.
4
≤37
Before WebView 66, this method returned null when the element was a child of a host node. See issue 759947.
18
Before Chrome 66, this method returned null when the element was a child of a host node. See issue 759947.
4
≤12.1
Before Opera Android 47, this method returned null when the element was a child of a host node. See issue 759947.
3.2
1.0
Before Samsung Internet 9.0, this method returned null when the element was a child of a host node. See issue 759947.
elementsFromPoint
43
Before Chrome 66, this method returned null when the element was a child of a host node. See issue 759947.
79
12-79
Returns a NodeList instead of an array. See the MSDN documentation. Returns null when the point provided has no elements beneath it (e.g., when given a point outside the document).
46
10
Returns a NodeList instead of an array. See the MSDN documentation. Returns null when the point provided has no elements beneath it (e.g., when given a point outside the document).
30
11.1
43
Before WebView 66, this method returned null when the element was a child of a host node. See issue 759947.
43
Before Chrome 66, this method returned null when the element was a child of a host node. See issue 759947.
46
30
11.3
4.0
Before Samsung Internet 9.0, this method returned null when the element was a child of a host node. See issue 759947.
fullscreenElement
71
20
79
12
12-14
64
9
11
58
15
12.1-15
6
71
≤37
71
25
64
9
50
14
12.1-14
12
Only available on iPad, not on iPhone.
10.0
1.5
getAnimations
84
61
Implements an older version of the specification.
84
79
Implements an older version of the specification.
75
63-75
No
70
48
Implements an older version of the specification.
14
13.1
Implements an older version of the specification, see Webkit bug 179536.
84
84
61
Implements an older version of the specification.
79
60
45
Implements an older version of the specification.
14
13.4
Implements an older version of the specification, see Webkit bug 179536.
14.0
pictureInPictureElement
69
79
No
No
56
13.1
No
No
No
No
13.4
No
pointerLockElement
37
12
50
14-50
No
24
10.1
37
37
50
14-50
24
No
3.0
styleSheets
1
12
1
4
≤12.1
4
1
18
4
≤12.1
3.2
1.0
getBoxQuads
No
No
31
No
No
No
No
No
31
No
No
No
append
54
17
49
No
41
10
54
54
49
41
10
6.0
childElementCount
29
17
25
No
16
9
≤37
29
25
16
9
2.0
children
29
16
25
No
16
9
≤37
29
25
16
9
2.0
firstElementChild
29
17
25
No
16
9
≤37
29
25
16
9
2.0
lastElementChild
29
17
25
No
16
9
≤37
29
25
16
9
2.0
prepend
54
17
49
No
41
10
54
54
49
41
10
6.0
querySelector
1
12
3.5
9
8
querySelectorAll() is supported, but only for CSS 2.1 selectors.
10
3.1
1
18
4
10.1
2
1.0
querySelectorAll
1
12
3.5
9
8
querySelectorAll() is supported, but only for CSS 2.1 selectors.
10
3.1
1
18
4
10.1
2
1.0
replaceChildren
86
86
78
No
72
14
86
86
79
61
14
14.0

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Document