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.
Document()
Document
object.This interface also inherits from the Node
and EventTarget
interfaces.
Document.anchors
Read only
Document.body
<body>
or <frameset>
node of the current document.Document.characterSet
Read only
Document.compatMode
Read only
Document.contentType
Read only
Document.doctype
Read only
Document.documentElement
Read only
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.documentURI
Read only
Document.embeds
Read only
<embed>
elements within the current document.Document.fonts
FontFaceSet
interface of the current document.Document.forms
Read only
<form>
elements within the current document.Document.head
Read only
<head>
element of the current document.Document.hidden
Read only
Document.images
Read only
Document.implementation
Read only
Document.lastStyleSheetSet
Read only
null
until the style sheet is changed by setting the value of selectedStyleSheetSet
.Document.links
Read only
Document.mozSyntheticDocument
Boolean
that is true
only if this document is synthetic, such as a standalone image, video, audio file, or the like.Document.mozFullScreenElement
Read only Document.mozFullScreenEnabled
Read only true
if calling Element.mozRequestFullscreen()
would succeed in the current document.Document.plugins
Read only
Document.policy
Read only
Policy
interface which provides a simple API for introspecting the feature policies applied to a specific document.Document.preferredStyleSheetSet
Read only
Document.scripts
Read only
<script>
elements on the document.Document.scrollingElement
Read only
Element
that scrolls the document.Document.selectedStyleSheetSet
Document.styleSheetSets
Read only
Document.timeline
Read only
Document.undoManager
Read only
Document.visibilityState
Read only
string
denoting the visibility state of the document. Possible values are visible
, hidden
, prerender
, and unloaded
.The Document
interface is extended with the ParentNode
interface:
ParentNode.childElementCount
Read only
ParentNode
which are elements.ParentNode.children
Read only
HTMLCollection
containing all of the Element
objects that are children of this ParentNode
, omitting all of its non-element nodes.ParentNode.firstElementChild
Read only
ParentNode
and is also an Element
, or null
if there is none.ParentNode.lastElementChild
Read only
ParentNode
and is an Element
, or null
if there is none.The Document
interface for HTML documents inherits from the HTMLDocument
interface or, since HTML5, is extended for such documents.
Document.cookie
Document.defaultView
Read only
Document.designMode
Document.dir
Read only
Document.domain
Document.lastModified
Read only
Document.location
Read only
Document.readyState
Read only Document.referrer
Read only
Document.title
Document.URL
Read only
The Document
interface includes the following properties defined on the DocumentOrShadowRoot
mixin. Note that this is currently only implemented by Chrome; other browsers still implement them directly on the Document
interface.
DocumentOrShadowRoot.activeElement
Read only
Element
within the shadow tree that has focus.Document.fullscreenElement
Read only
DocumentOrShadowRoot.pointerLockElement
Read only
null
if lock is pending, pointer is unlocked, or if the target is in another document.DocumentOrShadowRoot.styleSheets
Read only
StyleSheetList
of CSSStyleSheet
objects for stylesheets explicitly linked into, or embedded in a document.Document.onafterscriptexecute
afterscriptexecute
event.Document.onbeforescriptexecute
beforescriptexecute
event.Document.oncopy
copy
event.Document.oncut
cut
event.Document.onfullscreenchange
EventHandler
representing the code to be called when the fullscreenchange
event is raised.Document.onfullscreenerror
EventHandler
representing the code to be called when the fullscreenerror
event is raised.Document.onpaste
paste
event.Document.onpointerlockchange
pointerlockchange
event.Document.onpointerlockerror
pointerlockerror
event.Document.onreadystatechange
readystatechange
event.Document.onselectionchange
EventHandler
representing the code to be called when the selectionchange
event is raised.Document.onvisibilitychange
EventHandler
representing the code to be called when the visibilitychange
event is raised.Document.onwheel
wheel
event.The Document
interface is extended with the GlobalEventHandlers
interface:
GlobalEventHandlers.onabort
EventHandler
representing the code to be called when the abort
event is raised.GlobalEventHandlers.onanimationcancel
EventHandler
called when an animationcancel
event is sent, indicating that a running CSS animation has been canceled.GlobalEventHandlers.onanimationend
EventHandler
called when an animationend
event is sent, indicating that a CSS animation has stopped playing.GlobalEventHandlers.onanimationiteration
EventHandler
called when an animationiteration
event has been sent, indicating that a CSS animation has begun playing a new iteration of the animation sequence.GlobalEventHandlers.onanimationstart
EventHandler
called when an animationstart
event is sent, indicating that a CSS animation has started playing.GlobalEventHandlers.onauxclick
EventHandler
called when an auxclick
event is sent, indicating that a non-primary button has been pressed on an input device (e.g. a middle mouse button).GlobalEventHandlers.onblur
EventHandler
representing the code to be called when the blur
event is raised.GlobalEventHandlers.onerror
OnErrorEventHandler
representing the code to be called when the error
event is raised.GlobalEventHandlers.onfocus
EventHandler
representing the code to be called when the focus
event is raised.GlobalEventHandlers.oncancel
EventHandler
representing the code to be called when the cancel
event is raised.GlobalEventHandlers.oncanplay
EventHandler
representing the code to be called when the canplay
event is raised.GlobalEventHandlers.oncanplaythrough
EventHandler
representing the code to be called when the canplaythrough
event is raised.GlobalEventHandlers.onchange
EventHandler
representing the code to be called when the change
event is raised.GlobalEventHandlers.onclick
EventHandler
representing the code to be called when the click
event is raised.GlobalEventHandlers.onclose
EventHandler
representing the code to be called when the close
event is raised.GlobalEventHandlers.oncontextmenu
EventHandler
representing the code to be called when the contextmenu
event is raised.GlobalEventHandlers.oncuechange
EventHandler
representing the code to be called when the cuechange
event is raised.GlobalEventHandlers.ondblclick
EventHandler
representing the code to be called when the dblclick
event is raised.GlobalEventHandlers.ondrag
EventHandler
representing the code to be called when the drag
event is raised.GlobalEventHandlers.ondragend
EventHandler
representing the code to be called when the dragend
event is raised.GlobalEventHandlers.ondragenter
EventHandler
representing the code to be called when the dragenter
event is raised.GlobalEventHandlers.ondragexit
EventHandler
representing the code to be called when the dragexit
event is raised.GlobalEventHandlers.ondragleave
EventHandler
representing the code to be called when the dragleave
event is raised.GlobalEventHandlers.ondragover
EventHandler
representing the code to be called when the dragover
event is raised.GlobalEventHandlers.ondragstart
EventHandler
representing the code to be called when the dragstart
event is raised.GlobalEventHandlers.ondrop
EventHandler
representing the code to be called when the drop
event is raised.GlobalEventHandlers.ondurationchange
EventHandler
representing the code to be called when the durationchange
event is raised.GlobalEventHandlers.onemptied
EventHandler
representing the code to be called when the emptied
event is raised.GlobalEventHandlers.onended
EventHandler
representing the code to be called when the ended
event is raised.GlobalEventHandlers.ongotpointercapture
Is an EventHandler
representing the code to be called when the gotpointercapture
event type is raised.
GlobalEventHandlers.oninput
EventHandler
representing the code to be called when the input
event is raised.GlobalEventHandlers.oninvalid
EventHandler
representing the code to be called when the invalid
event is raised.GlobalEventHandlers.onkeydown
EventHandler
representing the code to be called when the keydown
event is raised.GlobalEventHandlers.onkeypress
EventHandler
representing the code to be called when the keypress
event is raised.GlobalEventHandlers.onkeyup
EventHandler
representing the code to be called when the keyup
event is raised.GlobalEventHandlers.onload
EventHandler
representing the code to be called when the load
event is raised.GlobalEventHandlers.onloadeddata
EventHandler
representing the code to be called when the loadeddata
event is raised.GlobalEventHandlers.onloadedmetadata
EventHandler
representing the code to be called when the loadedmetadata
event is raised.GlobalEventHandlers.onloadend
EventHandler
representing the code to be called when the loadend
event is raised (when progress has stopped on the loading of a resource.)GlobalEventHandlers.onloadstart
EventHandler
representing the code to be called when the loadstart
event is raised (when progress has begun on the loading of a resource.)GlobalEventHandlers.onlostpointercapture
Is an EventHandler
representing the code to be called when the lostpointercapture
event type is raised.
GlobalEventHandlers.onmousedown
EventHandler
representing the code to be called when the mousedown
event is raised.GlobalEventHandlers.onmouseenter
EventHandler
representing the code to be called when the mouseenter
event is raised.GlobalEventHandlers.onmouseleave
EventHandler
representing the code to be called when the mouseleave
event is raised.GlobalEventHandlers.onmousemove
EventHandler
representing the code to be called when the mousemove
event is raised.GlobalEventHandlers.onmouseout
EventHandler
representing the code to be called when the mouseout
event is raised.GlobalEventHandlers.onmouseover
EventHandler
representing the code to be called when the mouseover
event is raised.GlobalEventHandlers.onmouseup
EventHandler
representing the code to be called when the mouseup
event is raised.GlobalEventHandlers.onmousewheel
EventHandler
representing the code to be called when the mousewheel
event is raised. Deprecated. Use onwheel
instead.GlobalEventHandlers.onwheel
EventHandler
representing the code to be called when the wheel
event is raised.GlobalEventHandlers.onpause
EventHandler
representing the code to be called when the pause
event is raised.GlobalEventHandlers.onplay
EventHandler
representing the code to be called when the play
event is raised.GlobalEventHandlers.onplaying
EventHandler
representing the code to be called when the playing
event is raised.GlobalEventHandlers.onpointerdown
EventHandler
representing the code to be called when the pointerdown
event is raised.GlobalEventHandlers.onpointermove
EventHandler
representing the code to be called when the pointermove
event is raised.GlobalEventHandlers.onpointerup
EventHandler
representing the code to be called when the pointerup
event is raised.GlobalEventHandlers.onpointercancel
EventHandler
representing the code to be called when the pointercancel
event is raised.GlobalEventHandlers.onpointerover
EventHandler
representing the code to be called when the pointerover
event is raised.GlobalEventHandlers.onpointerout
EventHandler
representing the code to be called when the pointerout
event is raised.GlobalEventHandlers.onpointerenter
EventHandler
representing the code to be called when the pointerevent
event is raised.GlobalEventHandlers.onpointerleave
EventHandler
representing the code to be called when the pointerleave
event is raised.GlobalEventHandlers.onpointerlockchange
EventHandler
representing the code to be called when the pointerlockchange
event is raised.GlobalEventHandlers.onpointerlockerror
EventHandler
representing the code to be called when the pointerlockerror
event is raised.GlobalEventHandlers.onprogress
EventHandler
representing the code to be called when the progress
event is raised.GlobalEventHandlers.onratechange
EventHandler
representing the code to be called when the ratechange
event is raised.GlobalEventHandlers.onreset
EventHandler
representing the code to be called when the reset
event is raised.GlobalEventHandlers.onresize
EventHandler
representing the code to be called when the resize
event is raised.GlobalEventHandlers.onscroll
EventHandler
representing the code to be called when the scroll
event is raised.GlobalEventHandlers.onseeked
EventHandler
representing the code to be called when the seeked
event is raised.GlobalEventHandlers.onseeking
EventHandler
representing the code to be called when the seeking
event is raised.GlobalEventHandlers.onselect
EventHandler
representing the code to be called when the select
event is raised.GlobalEventHandlers.onselectstart
EventHandler
representing the code to be called when the selectionchange
event is raised, i.e. when the user starts to make a new text selection on a web page.GlobalEventHandlers.onselectionchange
EventHandler
representing the code to be called when the selectionchange
event is raised, i.e. when the text selected on a web page changes.GlobalEventHandlers.onshow
EventHandler
representing the code to be called when the show
event is raised.GlobalEventHandlers.onsort
EventHandler
representing the code to be called when the sort
event is raised.GlobalEventHandlers.onstalled
EventHandler
representing the code to be called when the stalled
event is raised.GlobalEventHandlers.onsubmit
EventHandler
representing the code to be called when the submit
event is raised.GlobalEventHandlers.onsuspend
EventHandler
representing the code to be called when the suspend
event is raised.GlobalEventHandlers.ontimeupdate
EventHandler
representing the code to be called when the timeupdate
event is raised.GlobalEventHandlers.onvolumechange
EventHandler
representing the code to be called when the volumechange
event is raised.GlobalEventHandlers.ontouchcancel
EventHandler
representing the code to be called when the touchcancel
event is raised.GlobalEventHandlers.ontouchend
EventHandler
representing the code to be called when the touchend
event is raised.GlobalEventHandlers.ontouchmove
EventHandler
representing the code to be called when the touchmove
event is raised.GlobalEventHandlers.ontouchstart
EventHandler
representing the code to be called when the touchstart
event is raised.GlobalEventHandlers.ontransitioncancel
EventHandler
called when a transitioncancel
event is sent, indicating that a CSS transition has been cancelled.GlobalEventHandlers.ontransitionend
EventHandler
called when a transitionend
event is sent, indicating that a CSS transition has finished playing.GlobalEventHandlers.onwaiting
EventHandler
representing the code to be called when the waiting
event is raised.Document.alinkColor
Document.all
Document.applets
Read only
Document.async
Document.load
to indicate an asynchronous request.Document.bgColor
Document.charset
Read only
Document.characterSet
. Use this property instead.Document.domConfig
DOMConfiguration
object.document.fgColor
Document.fullscreen
true
when the document is in full-screen mode
.Document.height
Document.inputEncoding
Read only
Document.characterSet
. Use this property instead.Document.linkColor
Document.vlinkColor
Document.width
Document.xmlEncoding
Document.xmlStandalone
Obsolete since Gecko 10.0
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
Obsolete since Gecko 10.0
"1.0"
if the declaration is absent.This interface also inherits from the Node
and EventTarget
interfaces.
Document.adoptNode()
Document.captureEvents()
Window.captureEvents
.Document.caretRangeFromPoint()
Range
object for the document fragment under the specified coordinates.Document.createAttribute()
Attr
object and returns it.Document.createAttributeNS()
Document.createCDATASection()
Document.createComment()
Document.createDocumentFragment()
Document.createElement()
Document.createElementNS()
Document.createEntityReference()
Document.createEvent()
Document.createNodeIterator()
NodeIterator
object.Document.createProcessingInstruction()
ProcessingInstruction
object.Document.createRange()
Range
object.Document.createTextNode()
Document.createTouch()
Touch
object.Document.createTouchList()
TouchList
object.Document.createTreeWalker()
TreeWalker
object.Document.enableStyleSheetsForSet()
Document.exitPointerLock()
Document.getAnimations()
Animation
objects currently in effect, whose target elements are descendants of the document
.Document.getElementsByClassName()
Document.getElementsByTagName()
Document.getElementsByTagNameNS()
Document.hasStorageAccess()
Promise
that resolves with a boolean value indicating whether the document has access to its first-party storage.Document.importNode()
Document.normalizeDocument()
Document.releaseCapture()
Document.releaseEvents()
Window.releaseEvents()
.Document.requestStorageAccess()
Promise
that resolves if the access to first-party storage was granted, and rejects if access was denied.Document.routeEvent()
Obsolete since Gecko 24
Window.routeEvent()
.Document.mozSetImageElement()
The Document
interface is extended with the ParentNode
interface:
document.getElementById(String id)
document.querySelector(String selector)
document.querySelectorAll(String selector)
The Document
interface is extended with the XPathEvaluator
interface:
document.createExpression(String expression, XPathNSResolver resolver)
XPathExpression
which can then be used for (repeated) evaluations.document.createNSResolver(Node resolver)
XPathNSResolver
object.document.evaluate(String expression, Node contextNode, XPathNSResolver resolver, Number type, Object result)
The Document
interface for HTML documents inherit from the HTMLDocument
interface or, since HTML5, is extended for such documents:
document.clear()
document.close()
document.execCommand(String command[, Boolean showUI[, String value]])
document.getElementsByName(String name)
document.hasFocus()
true
if the focus is currently located anywhere inside the specified document.document.open()
document.queryCommandEnabled(String command)
document.queryCommandIndeterm(String command)
document.queryCommandState(String command)
document.queryCommandSupported(String command)
document.queryCommandValue(String command)
document.write(String text)
document.writeln(String text)
The Document
interface includes the following methods defined on the DocumentOrShadowRoot
mixin. Note that this is currently only implemented by Chrome; other browsers still implement them on the Document
interface.
DocumentOrShadowRoot.getSelection()
Selection
object representing the range of text selected by the user, or the current position of the caret.DocumentOrShadowRoot.elementFromPoint()
DocumentOrShadowRoot.elementsFromPoint()
DocumentOrShadowRoot.caretPositionFromPoint()
CaretPosition
object containing the DOM node containing the caret, and caret's character offset within that node. 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.
Mozilla defines a set of non-standard properties made only for XUL content:
document.currentScript
<script>
element that is currently executing.document.documentURIObject
nsIURI
object representing the URI of the document. This property only has special meaning in privileged JavaScript code (with UniversalXPConnect privileges).document.popupNode
document.tooltipNode
Mozilla also define some non-standard methods:
document.execCommandShowHelp
Obsolete since Gecko 14.0
document.getBoxObjectFor
Element.getBoundingClientRect()
method instead.document.loadOverlay
document.queryCommandText
Obsolete since Gecko 14.0
Microsoft defines some non-standard properties:
document.fileSize
*
Internet Explorer does not support all methods from the Node
interface in the Document
interface:
document.contains
document.body.contains()
can be used.Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | Yes | Yes | Yes | Yes | Yes | Yes |
Document() constructor |
60 | ? | ? | ? | 47 | ? |
URL |
Yes | Yes | Yes | Yes | Yes | Yes |
adoptNode |
Yes | ? | Yes | ? | ? | ? |
alinkColor
|
Yes | ? | Yes | ? | ? | ? |
all
|
Yes | ? | Yes | ? | ? | ? |
anchors
|
Yes | ? | Yes | ? | ? | ? |
applets
|
Yes | 18 | Yes | ? | ? | ? |
async
|
No | ? | No | ? | ? | ? |
bgColor
|
Yes | ? | Yes | ? | ? | ? |
body |
1 | Yes | 2
|
6 | 9.6 | 4 |
captureEvents
|
Yes | ? | Yes | ? | ? | ? |
caretRangeFromPoint
|
43 | 12 | 20 | No | 15 | Yes |
characterSet |
45
|
Yes
|
Yes
|
?
|
?
|
?
|
clear
|
Yes | ? | Yes | ? | ? | ? |
close |
Yes | ? | Yes | ? | ? | ? |
compatMode
|
Yes | ? | Yes | ? | ? | ? |
contains |
Yes | ? | Yes | No | ? | ? |
contentType
|
Yes | ? | Yes | ? | ? | ? |
cookie |
Yes | Yes | Yes | Yes | Yes | Yes |
createAttribute |
Yes | Yes | 44
|
Yes | Yes | Yes |
createAttributeNS |
Yes | ? | Yes | ? | ? | ? |
createCDATASection |
Yes | ? | Yes | ? | ? | ? |
createComment |
Yes | ? | Yes | Yes | ? | 7 |
createDocumentFragment |
Yes | Yes | Yes | Yes | Yes | Yes |
createElement |
Yes | Yes | Yes
|
Yes | Yes | Yes |
createElementNS |
Yes | Yes | Yes
|
Yes | Yes | Yes |
createEntityReference
|
No | ? | No | ? | ? | ? |
createEvent |
Yes | ? | Yes | ? | ? | ? |
createExpression |
Yes | ? | Yes | ? | ? | ? |
createNSResolver |
Yes | ? | Yes | ? | ? | ? |
createNodeIterator |
Yes | ? | Yes | ? | ? | ? |
createProcessingInstruction |
Yes | ? | Yes | ? | ? | ? |
createRange |
Yes | ? | Yes | ? | ? | ? |
createTextNode |
Yes | Yes | Yes | Yes | Yes | ? |
createTouch
|
22 — 66
|
Yes | 18 | No | ? — 53 | No |
createTouchList
|
22 | Yes | 18 | No | No | No |
createTreeWalker |
4 | Yes | 2 | 9 | 9 | 3 |
currentScript |
29 | Yes | 4 | No | 16 | 8 |
defaultView |
Yes | Yes | Yes | 9 | Yes | Yes |
designMode |
Yes | Yes | Yes | Yes | Yes | Yes |
dir |
Yes | Yes | Yes
|
Yes | ? | ? |
doctype |
Yes | ? | Yes | ? | ? | ? |
documentElement |
Yes | ? | Yes | ? | ? | ? |
documentURI |
Yes | ? | Yes | Yes | Yes | Yes |
documentURIObject
|
No | No | ? — 57
|
No | No | No |
domConfig
|
No | ? | No | ? | ? | ? |
domain |
Yes | ? | Yes
|
? | ? | ? |
embeds |
Yes | ? | Yes | ? | ? | ? |
enableStyleSheetsForSet |
No | ? | Yes | ? | ? | ? |
evaluate |
1 | Yes | 1.5 | No | 9 | 5 |
execCommand |
Yes | Yes | Yes | Yes | Yes | Yes |
execCommandShowHelp
|
No | No | ? — 14
|
No | No | No |
exitFullscreen |
45
|
12 | 64
|
11
|
15
|
5.1
|
exitPointerLock
|
Yes
|
Yes | 50
|
? | ? | ? |
fgColor
|
Yes | ? | Yes | ? | ? | ? |
fileSize
|
No | No | No | ? — 11 | No | No |
fonts |
60 | No | 41
|
No | 47 | 10 |
forms |
Yes | ? | Yes | ? | ? | ? |
fullscreen
|
Yes
|
? | 64
|
? | ? | Yes
|
fullscreenEnabled |
45
|
? | 64
|
11
|
? | ? |
getAnimations
|
No | No | No
|
No | No | No |
getBoxObjectFor
|
No | No | ? — ? | No | No | No |
getElementById |
1 | Yes | 1 | 5.5 | 7 | 1 |
getElementsByClassName |
Yes | Yes | 4 | 9 | Yes | Yes |
getElementsByName |
Yes | Yes
|
Yes | Yes
|
Yes | Yes |
getElementsByTagName |
Yes | ? | Yes | ? | ? | ? |
getElementsByTagNameNS |
Yes | ? | Yes | ? | ? | ? |
hasFocus |
30 | Yes | 3 | 6 | Yes | Yes |
hasStorageAccess
|
No | No | 65
|
No | No | 11.1
|
head |
Yes | Yes | 4 | 9 | 11 | 5 |
height
|
No | ? | No | ? | ? | ? |
hidden |
33
|
Yes | 18
|
10 | 12.1 | 7 |
images |
Yes | ? | Yes | ? | ? | ? |
implementation |
Yes | ? | Yes | ? | ? | ? |
importNode |
Yes | Yes | 4 | 9 | 9 | Yes |
lastModified |
Yes | ? | Yes | ? | ? | ? |
lastStyleSheetSet |
No | ? | Yes | ? | ? | ? |
linkColor
|
Yes | ? | Yes | ? | ? | ? |
links |
Yes | Yes | Yes | Yes | Yes | Yes |
loadOverlay
|
No | No | 61 — 63
|
No | No | No |
location |
Yes | Yes | Yes | Yes | Yes | Yes |
mozSetImageElement
|
No | No | No | No | No | No |
mozSyntheticDocument
|
No | No | No | No | No | No |
normalizeDocument
|
No | ? | No | ? | ? | ? |
onafterscriptexecute
|
No | ? | Yes | ? | ? | ? |
onbeforescriptexecute
|
No | ? | Yes | ? | ? | ? |
oncopy
|
Yes | ? | Yes | ? | ? | ? |
oncut
|
Yes | ? | Yes | ? | ? | ? |
onfreeze
|
68 | No | No | No | 55 | No |
onfullscreenchange |
45 | ? | 64
|
11
|
? | ? |
onfullscreenerror |
45 | ? | 64
|
11
|
? | ? |
onpaste
|
Yes | ? | Yes | ? | ? | ? |
onpointerlockchange
|
Yes | ? | Yes | ? | ? | ? |
onpointerlockerror
|
Yes | ? | Yes | ? | ? | ? |
onreadystatechange |
Yes | ? | Yes | ? | ? | ? |
onresume
|
68 | No | No | No | 55 | No |
onselectionchange
|
49 | Yes | 45
|
? | ? | ? |
onvisibilitychange |
33
|
Yes | 56 | 10 | 12.1
|
7 |
open |
Yes | Yes | Yes | Yes | Yes | Yes |
origin |
41 | ? | No | Yes | Yes | ? |
plugins |
Yes | ? | Yes | ? | ? | ? |
policy
|
69
|
No | No | No | 56
|
No |
popupNode
|
No | No | Yes
|
No | No | No |
preferredStyleSheetSet |
Yes | ? | Yes | ? | ? | ? |
queryCommandEnabled |
17 | Yes | 41
|
4 | ? | ? |
queryCommandIndeterm |
Yes | ? | Yes | ? | ? | ? |
queryCommandState |
Yes | Yes | Yes | Yes | Yes | Yes |
queryCommandSupported |
17 | Yes | 41
|
4 | ? | ? |
queryCommandText
|
No | No | ? — 14
|
No | No | No |
queryCommandValue |
Yes | ? | Yes | ? | ? | ? |
querySelector |
1 | Yes | 3.5 | 8 | 10 | 3.2 |
querySelectorAll |
1 | Yes | 3.5 | 8 | 10 | 3.2 |
readyState |
Yes | Yes | 4 | 9
|
11
|
5 |
referrer |
Yes | ? | Yes | ? | ? | ? |
registerElement
|
35 | No | 31 — 59
|
No | 25 | No |
releaseCapture
|
No | ? | Yes | ? | ? | ? |
releaseEvents
|
Yes | ? | Yes | ? | ? | ? |
requestStorageAccess
|
No | No | 65
|
No | No | 11.1
|
routeEvent
|
No | ? | No | ? | ? | ? |
scripts |
Yes | Yes | 9 | 4 | Yes | Yes |
scrollingElement |
44 | Yes | 48
|
No | 31 | 9 |
selectedStyleSheetSet |
Yes | ? | Yes | ? | ? | ? |
styleSheetSets |
No | ? | Yes | ? | ? | ? |
timeline
|
No | No | No
|
Yes | Yes | Yes |
title |
Yes | ? | Yes | ? | ? | ? |
tooltipNode
|
No | No | Yes
|
No | No | No |
undoManager
|
No | ? | No | ? | ? | ? |
visibilityState |
33
|
? | 18
|
10 | 12.1
|
7 |
vlinkColor
|
No | ? | Yes | ? | ? | ? |
wasDiscarded
|
68 | No | No | No | 55 | No |
width
|
No | ? | No | ? | ? | ? |
write |
Yes | ? | Yes | ? | ? | ? |
writeln |
Yes | ? | Yes | ? | ? | ? |
xmlEncoding
|
Yes | ? | No | ? | ? | ? |
xmlStandalone
|
Yes | ? | No | ? | ? | ? |
xmlVersion
|
Yes | ? | No | ? | ? | ? |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | Yes | Yes | Yes | Yes | Yes | ? |
Document() constructor |
60 | 60 | ? | ? | 47 | ? | ? |
URL |
Yes | Yes | Yes | Yes | Yes | Yes | ? |
adoptNode |
Yes | Yes | ? | Yes | ? | ? | ? |
alinkColor
|
Yes | Yes | ? | Yes | ? | ? | ? |
all
|
Yes | Yes | ? | Yes | ? | ? | ? |
anchors
|
Yes | Yes | ? | Yes | ? | ? | ? |
applets
|
Yes | Yes | ? | Yes | ? | ? | ? |
async
|
No | No | ? | No | ? | ? | ? |
bgColor
|
Yes | Yes | ? | Yes | ? | ? | ? |
body |
Yes | Yes | Yes | Yes
|
Yes | 5 | ? |
captureEvents
|
Yes | Yes | ? | Yes | ? | ? | ? |
caretRangeFromPoint
|
43 | 43 | 12 | 20 | 15 | Yes | ? |
characterSet |
45
|
45
|
Yes
|
Yes
|
?
|
?
|
? |
clear
|
Yes | Yes | ? | Yes | ? | ? | ? |
close |
Yes | Yes | ? | Yes | ? | ? | ? |
compatMode
|
Yes | Yes | ? | Yes | ? | ? | ? |
contains |
Yes | Yes | ? | Yes | ? | ? | ? |
contentType
|
Yes | Yes | ? | Yes | ? | ? | ? |
cookie |
Yes | Yes | Yes | Yes | Yes | Yes | ? |
createAttribute |
Yes | Yes | Yes | 44
|
Yes | Yes | ? |
createAttributeNS |
Yes | Yes | ? | Yes | ? | ? | ? |
createCDATASection |
Yes | Yes | ? | Yes | ? | ? | ? |
createComment |
Yes | Yes | ? | Yes | ? | ? | ? |
createDocumentFragment |
Yes | Yes | Yes | Yes | Yes | Yes | ? |
createElement |
Yes | Yes | Yes | Yes | Yes | Yes | ? |
createElementNS |
Yes | Yes | Yes | Yes | Yes | Yes | ? |
createEntityReference
|
No | No | ? | No | ? | ? | ? |
createEvent |
Yes | Yes | ? | Yes | ? | ? | ? |
createExpression |
Yes | Yes | ? | Yes | ? | ? | ? |
createNSResolver |
Yes | Yes | ? | Yes | ? | ? | ? |
createNodeIterator |
Yes | Yes | ? | Yes | ? | ? | ? |
createProcessingInstruction |
Yes | Yes | ? | Yes | ? | ? | ? |
createRange |
Yes | Yes | ? | Yes | ? | ? | ? |
createTextNode |
Yes | Yes | Yes | Yes | Yes | ? | ? |
createTouch
|
? — 66
|
25 — 66
|
Yes | 6 | ? — 53 | Yes | ? |
createTouchList
|
Yes | 25 | Yes | 6 | Yes | Yes | ? |
createTreeWalker |
Yes | Yes | Yes | 4 | 9 | 3 | ? |
currentScript |
Yes | Yes | Yes | Yes | Yes | 8 | ? |
defaultView |
Yes | Yes | ? | Yes | ? | ? | ? |
designMode |
Yes | Yes | ? | ? | ? | ? | ? |
dir |
Yes | Yes | Yes | Yes
|
? | ? | ? |
doctype |
Yes | Yes | ? | Yes | ? | ? | ? |
documentElement |
Yes | Yes | ? | Yes | ? | ? | ? |
documentURI |
Yes | Yes | ? | Yes | Yes | Yes | ? |
documentURIObject
|
No | No | No | ? — 57
|
No | No | ? |
domConfig
|
No | No | ? | No | ? | ? | ? |
domain |
Yes | Yes | ? | Yes
|
? | ? | ? |
embeds |
Yes | Yes | ? | Yes | ? | ? | ? |
enableStyleSheetsForSet |
No | No | ? | Yes | ? | ? | ? |
evaluate |
Yes | Yes | Yes | Yes | Yes | Yes | ? |
execCommand |
Yes | Yes | Yes | Yes | Yes | Yes | ? |
execCommandShowHelp
|
No | No | No | ? — 14
|
No | No | ? |
exitFullscreen |
45
|
45
|
? | 64
|
? | No | ? |
exitPointerLock
|
Yes
|
Yes
|
Yes | 50
|
? | ? | ? |
fgColor
|
Yes | Yes | ? | Yes | ? | ? | ? |
fileSize
|
No | No | No | No | No | No | ? |
fonts |
60 | 60 | No | Yes | 47 | 10.2 | 5.0 |
forms |
Yes | Yes | ? | Yes | ? | ? | ? |
fullscreen
|
? | Yes
|
? | 64
|
? | ? | ? |
fullscreenEnabled |
45
|
45
|
? | 64
|
? | ? | ? |
getAnimations
|
No | No | No | No | No | No | ? |
getBoxObjectFor
|
No | No | No | No | No | No | ? |
getElementById |
1 | 18 | Yes | Yes | 6 | 1 | ? |
getElementsByClassName |
Yes | Yes | Yes | 4 | Yes | Yes | ? |
getElementsByName |
Yes | Yes | Yes
|
Yes | Yes | Yes | ? |
getElementsByTagName |
Yes | Yes | ? | Yes | ? | ? | ? |
getElementsByTagNameNS |
Yes | Yes | ? | Yes | ? | ? | ? |
hasFocus |
Yes | Yes | Yes | 4 | Yes | Yes | ? |
hasStorageAccess
|
No | No | No | 65
|
No | 11.1
|
? |
head |
Yes | Yes | Yes | 4 | Yes | Yes | ? |
height
|
No | No | ? | No | ? | ? | ? |
hidden |
Yes | Yes | Yes | 18
|
12.1 | 7 | ? |
images |
Yes | Yes | ? | Yes | ? | ? | ? |
implementation |
Yes | Yes | ? | Yes | ? | ? | ? |
importNode |
Yes | Yes | 12 | 4 | 9 | Yes | ? |
lastModified |
Yes | Yes | ? | Yes | ? | ? | ? |
lastStyleSheetSet |
No | No | ? | Yes | ? | ? | ? |
linkColor
|
Yes | Yes | ? | Yes | ? | ? | ? |
links |
Yes | Yes | Yes | Yes | Yes | Yes | ? |
loadOverlay
|
No | No | No | No | No | No | ? |
location |
Yes | Yes | Yes | Yes | Yes | Yes | ? |
mozSetImageElement
|
No | No | No | No | No | No | ? |
mozSyntheticDocument
|
No | No | No | No | No | No | ? |
normalizeDocument
|
No | No | ? | No | ? | ? | ? |
onafterscriptexecute
|
No | No | ? | Yes | ? | ? | ? |
onbeforescriptexecute
|
No | No | ? | Yes | ? | ? | ? |
oncopy
|
Yes | Yes | ? | Yes | ? | ? | ? |
oncut
|
Yes | Yes | ? | Yes | ? | ? | ? |
onfreeze
|
68 | 68 | No | No | 55 | No | ? |
onfullscreenchange |
45 | 45 | ? | 64
|
? | ? | ? |
onfullscreenerror |
45 | 45 | ? | 64
|
? | ? | ? |
onpaste
|
Yes | Yes | ? | Yes | ? | ? | ? |
onpointerlockchange
|
Yes | Yes | ? | Yes | ? | ? | ? |
onpointerlockerror
|
Yes | Yes | ? | Yes | ? | ? | ? |
onreadystatechange |
Yes | Yes | ? | Yes | ? | ? | ? |
onresume
|
68 | 68 | No | No | 55 | No | ? |
onselectionchange
|
49 | 49 | Yes | 45
|
? | ? | ? |
onvisibilitychange |
4.4.3 | 33 | Yes | 56 | 12.1
|
7 | ? |
open |
Yes | Yes | Yes | Yes | Yes | Yes | ? |
origin |
Yes | 41 | ? | No | Yes | ? | ? |
plugins |
Yes | Yes | ? | Yes | ? | ? | ? |
policy
|
69
|
69
|
No | No | 56
|
No | ? |
popupNode
|
No | No | No | No | No | No | ? |
preferredStyleSheetSet |
Yes | Yes | ? | Yes | ? | ? | ? |
queryCommandEnabled |
Yes | Yes | Yes | 41
|
? | ? | ? |
queryCommandIndeterm |
Yes | Yes | ? | Yes | ? | ? | ? |
queryCommandState |
Yes | Yes | Yes | Yes | Yes | Yes | ? |
queryCommandSupported |
Yes | Yes | Yes | 41
|
? | ? | ? |
queryCommandText
|
No | No | No | ? — 14
|
No | No | ? |
queryCommandValue |
Yes | Yes | ? | Yes | ? | ? | ? |
querySelector |
Yes | Yes | Yes | Yes | 10 | 3.2 | ? |
querySelectorAll |
Yes | Yes | Yes | Yes | 10 | Yes | ? |
readyState |
Yes | Yes | Yes | 4 | 11
|
5 | ? |
referrer |
Yes | Yes | ? | Yes | ? | ? | ? |
registerElement
|
37 | 35 | No | 31 — 59
|
25 | No | ? |
releaseCapture
|
No | No | ? | Yes | ? | ? | ? |
releaseEvents
|
Yes | Yes | ? | Yes | ? | ? | ? |
requestStorageAccess
|
No | No | No | 65
|
No | 11.1
|
? |
routeEvent
|
No | No | ? | No | ? | ? | ? |
scripts |
Yes | Yes | Yes | 9 | Yes | Yes | ? |
scrollingElement |
44 | 44 | Yes | Yes | 31 | 9 | ? |
selectedStyleSheetSet |
Yes | Yes | ? | Yes | ? | ? | ? |
styleSheetSets |
No | No | ? | Yes | ? | ? | ? |
timeline
|
No | No | No | No
|
Yes | Yes | ? |
title |
Yes | Yes | ? | Yes | ? | ? | ? |
tooltipNode
|
No | No | No | No | No | No | ? |
undoManager
|
No | No | ? | No | ? | ? | ? |
visibilityState |
4.4.3 | 33 | ? | 18
|
12.1
|
7 | ? |
vlinkColor
|
No | No | ? | Yes | ? | ? | ? |
wasDiscarded
|
68 | 68 | No | No | 55 | No | ? |
width
|
No | No | ? | No | ? | ? | ? |
write |
Yes | Yes | ? | Yes | ? | ? | ? |
writeln |
Yes | Yes | ? | Yes | ? | ? | ? |
xmlEncoding
|
Yes | Yes | ? | No | ? | ? | ? |
xmlStandalone
|
Yes | Yes | ? | No | ? | ? | ? |
xmlVersion
|
Yes | Yes | ? | No | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Document