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.
Extends
Node.DocumentOrShadowRoot.FontFaceSource.GlobalEventHandlers.NonElementParentNode.ParentNode.XPathEvaluatorBase
Extended by
Accessors
location
Get Signature
get location(): Location;
The read-only location property of the Document interface returns a Location object, which contains information about the URL of the document and provides methods for changing that URL and loading another URL.
Returns
Set Signature
set location(href): void;
Parameters
| Parameter | Type |
|---|---|
href | string |
Returns
void
textContent
Get Signature
get textContent(): null;
Returns
null
The textContent property of the Node interface represents the text content of the node and its descendants.
Overrides
Methods
addEventListener()
Call Signature
addEventListener<K>(
type,
listener,
options?
): void;
The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Type Parameters
| Type Parameter |
|---|
K extends keyof DocumentEventMap |
Parameters
| Parameter | Type |
|---|---|
type | K |
listener | (this, ev) => any |
options? | boolean | AddEventListenerOptions |
Returns
void
Overrides
Call Signature
addEventListener(
type,
listener,
options?
): void;
The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Parameters
| Parameter | Type |
|---|---|
type | string |
listener | EventListenerOrEventListenerObject |
options? | boolean | AddEventListenerOptions |
Returns
void
Overrides
GlobalEventHandlers.addEventListener
adoptNode()
adoptNode<T>(node): T;
Document.adoptNode() transfers a node from another document into the method's document. The adopted node and its subtree are removed from their original document (if any), and their ownerDocument is changed to the current document. The node can then be inserted into the current document.
Type Parameters
| Type Parameter |
|---|
T extends Node |
Parameters
| Parameter | Type |
|---|---|
node | T |
Returns
T
append()
append(...nodes): void;
Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
Parameters
| Parameter | Type |
|---|---|
...nodes | (string | Node)[] |
Returns
void
Inherited from
appendChild()
appendChild<T>(node): T;
The appendChild() method of the Node interface adds a node to the end of the list of children of a specified parent node.
Type Parameters
| Type Parameter |
|---|
T extends Node |
Parameters
| Parameter | Type |
|---|---|
node | T |
Returns
T
Inherited from
captureEvents()
captureEvents(): void;
Returns
void
Deprecated
caretPositionFromPoint()
caretPositionFromPoint(
x,
y,
options?
): CaretPosition | null;
The caretPositionFromPoint() method of the Document interface returns a CaretPosition object, containing the DOM node, along with the caret and caret's character offset within that node.
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
options? | CaretPositionFromPointOptions |
Returns
CaretPosition | null
caretRangeFromPoint()
caretRangeFromPoint(x, y): Range | null;
The caretRangeFromPoint() method of the Document interface returns a Range object for the document fragment under the specified coordinates.
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
Returns
Range | null
Deprecated
clear()
clear(): void;
The Document.clear() method does nothing, but doesn't raise any error.
Returns
void
Deprecated
cloneNode()
cloneNode(subtree?): Node;
The cloneNode() method of the Node interface returns a duplicate of the node on which this method was called. Its parameter controls if the subtree contained in the node is also cloned or not.
Parameters
| Parameter | Type |
|---|---|
subtree? | boolean |
Returns
Inherited from
close()
close(): void;
The Document.close() method finishes writing to a document, opened with Document.open().
Returns
void
compareDocumentPosition()
compareDocumentPosition(other): number;
The compareDocumentPosition() method of the Node interface reports the position of its argument node relative to the node on which it is called.
Parameters
| Parameter | Type |
|---|---|
other | Node |
Returns
number
Inherited from
contains()
contains(other): boolean;
The contains() method of the Node interface returns a boolean value indicating whether a node is a descendant of a given node, that is the node itself, one of its direct children (childNodes), one of the children's direct children, and so on.
Parameters
| Parameter | Type |
|---|---|
other | Node | null |
Returns
boolean
Inherited from
createAttribute()
createAttribute(localName): Attr;
The Document.createAttribute() method creates a new attribute node, and returns it. The object created is a node implementing the Attr interface. The DOM does not enforce what sort of attributes can be added to a particular element in this manner.
Parameters
| Parameter | Type |
|---|---|
localName | string |
Returns
createAttributeNS()
createAttributeNS(namespace, qualifiedName): Attr;
The Document.createAttributeNS() method creates a new attribute node with the specified namespace URI and qualified name, and returns it. The object created is a node implementing the Attr interface. The DOM does not enforce what sort of attributes can be added to a particular element in this manner.
Parameters
| Parameter | Type |
|---|---|
namespace | string | null |
qualifiedName | string |
Returns
createCDATASection()
createCDATASection(data): CDATASection;
createCDATASection() creates a new CDATA section node, and returns it.
Parameters
| Parameter | Type |
|---|---|
data | string |
Returns
createComment()
createComment(data): Comment;
createComment() creates a new comment node, and returns it.
Parameters
| Parameter | Type |
|---|---|
data | string |
Returns
createDocumentFragment()
createDocumentFragment(): DocumentFragment;
Creates a new empty DocumentFragment into which DOM nodes can be added to build an offscreen DOM tree.
Returns
createElement()
Call Signature
createElement<K>(tagName, options?): HTMLElementTagNameMap[K];
In an HTML document, the document.createElement() method creates the HTML element specified by localName, or an HTMLUnknownElement if localName isn't recognized.
Type Parameters
| Type Parameter |
|---|
K extends keyof HTMLElementTagNameMap |
Parameters
| Parameter | Type |
|---|---|
tagName | K |
options? | ElementCreationOptions |
Returns
Call Signature
createElement<K>(tagName, options?): HTMLElementDeprecatedTagNameMap[K];
Type Parameters
| Type Parameter |
|---|
K extends keyof HTMLElementDeprecatedTagNameMap |
Parameters
| Parameter | Type |
|---|---|
tagName | K |
options? | ElementCreationOptions |
Returns
HTMLElementDeprecatedTagNameMap[K]
Deprecated
Call Signature
createElement(tagName, options?): HTMLElement;
Parameters
| Parameter | Type |
|---|---|
tagName | string |
options? | ElementCreationOptions |
Returns
createElementNS()
Call Signature
createElementNS(namespaceURI, qualifiedName): HTMLElement;
Creates an element with the specified namespace URI and qualified name.
Parameters
| Parameter | Type |
|---|---|
namespaceURI | "http://www.w3.org/1999/xhtml" |
qualifiedName | string |
Returns
Call Signature
createElementNS<K>(namespaceURI, qualifiedName): SVGElementTagNameMap[K];
Type Parameters
| Type Parameter |
|---|
K extends keyof SVGElementTagNameMap |
Parameters
| Parameter | Type |
|---|---|
namespaceURI | "http://www.w3.org/2000/svg" |
qualifiedName | K |
Returns
Call Signature
createElementNS(namespaceURI, qualifiedName): SVGElement;
Parameters
| Parameter | Type |
|---|---|
namespaceURI | "http://www.w3.org/2000/svg" |
qualifiedName | string |
Returns
Call Signature
createElementNS<K>(namespaceURI, qualifiedName): MathMLElementTagNameMap[K];
Type Parameters
| Type Parameter |
|---|
K extends keyof MathMLElementTagNameMap |
Parameters
| Parameter | Type |
|---|---|
namespaceURI | "http://www.w3.org/1998/Math/MathML" |
qualifiedName | K |
Returns
Call Signature
createElementNS(namespaceURI, qualifiedName): MathMLElement;
Parameters
| Parameter | Type |
|---|---|
namespaceURI | "http://www.w3.org/1998/Math/MathML" |
qualifiedName | string |
Returns
Call Signature
createElementNS(
namespaceURI,
qualifiedName,
options?
): Element;
Parameters
| Parameter | Type |
|---|---|
namespaceURI | string | null |
qualifiedName | string |
options? | ElementCreationOptions |
Returns
Call Signature
createElementNS(
namespace,
qualifiedName,
options?
): Element;
Parameters
| Parameter | Type |
|---|---|
namespace | string | null |
qualifiedName | string |
options? | string | ElementCreationOptions |
Returns
createEvent()
Call Signature
createEvent(eventInterface): AnimationEvent;
Creates an event of the type specified. The returned object should be first initialized and can then be passed to EventTarget.dispatchEvent.
Parameters
| Parameter | Type |
|---|---|
eventInterface | "AnimationEvent" |
Returns
Deprecated
Call Signature
createEvent(eventInterface): AnimationPlaybackEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "AnimationPlaybackEvent" |
Returns
Call Signature
createEvent(eventInterface): AudioProcessingEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "AudioProcessingEvent" |
Returns
Call Signature
createEvent(eventInterface): BeforeUnloadEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "BeforeUnloadEvent" |
Returns
Call Signature
createEvent(eventInterface): BlobEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "BlobEvent" |
Returns
Call Signature
createEvent(eventInterface): ClipboardEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "ClipboardEvent" |
Returns
Call Signature
createEvent(eventInterface): CloseEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "CloseEvent" |
Returns
Call Signature
createEvent(eventInterface): CommandEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "CommandEvent" |
Returns
Call Signature
createEvent(eventInterface): CompositionEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "CompositionEvent" |
Returns
Call Signature
createEvent(eventInterface): ContentVisibilityAutoStateChangeEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "ContentVisibilityAutoStateChangeEvent" |
Returns
ContentVisibilityAutoStateChangeEvent
Call Signature
createEvent(eventInterface): CookieChangeEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "CookieChangeEvent" |
Returns
Call Signature
createEvent(eventInterface): CustomEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "CustomEvent" |
Returns
Call Signature
createEvent(eventInterface): DeviceMotionEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "DeviceMotionEvent" |
Returns
Call Signature
createEvent(eventInterface): DeviceOrientationEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "DeviceOrientationEvent" |
Returns
Call Signature
createEvent(eventInterface): DragEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "DragEvent" |
Returns
Call Signature
createEvent(eventInterface): ErrorEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "ErrorEvent" |
Returns
Call Signature
createEvent(eventInterface): Event;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "Event" |
Returns
Call Signature
createEvent(eventInterface): Event;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "Events" |
Returns
Call Signature
createEvent(eventInterface): FocusEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "FocusEvent" |
Returns
Call Signature
createEvent(eventInterface): FontFaceSetLoadEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "FontFaceSetLoadEvent" |
Returns
Call Signature
createEvent(eventInterface): FormDataEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "FormDataEvent" |
Returns
Call Signature
createEvent(eventInterface): GPUUncapturedErrorEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "GPUUncapturedErrorEvent" |
Returns
Call Signature
createEvent(eventInterface): GamepadEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "GamepadEvent" |
Returns
Call Signature
createEvent(eventInterface): HashChangeEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "HashChangeEvent" |
Returns
Call Signature
createEvent(eventInterface): IDBVersionChangeEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "IDBVersionChangeEvent" |
Returns
Call Signature
createEvent(eventInterface): InputEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "InputEvent" |
Returns
Call Signature
createEvent(eventInterface): KeyboardEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "KeyboardEvent" |
Returns
Call Signature
createEvent(eventInterface): MIDIConnectionEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "MIDIConnectionEvent" |
Returns
Call Signature
createEvent(eventInterface): MIDIMessageEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "MIDIMessageEvent" |
Returns
Call Signature
createEvent(eventInterface): MediaEncryptedEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "MediaEncryptedEvent" |
Returns
Call Signature
createEvent(eventInterface): MediaKeyMessageEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "MediaKeyMessageEvent" |
Returns
Call Signature
createEvent(eventInterface): MediaQueryListEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "MediaQueryListEvent" |
Returns
Call Signature
createEvent(eventInterface): MediaStreamTrackEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "MediaStreamTrackEvent" |
Returns
Call Signature
createEvent(eventInterface): MessageEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "MessageEvent" |
Returns
Call Signature
createEvent(eventInterface): MouseEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "MouseEvent" |
Returns
Call Signature
createEvent(eventInterface): MouseEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "MouseEvents" |
Returns
Call Signature
createEvent(eventInterface): NavigateEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "NavigateEvent" |
Returns
Call Signature
createEvent(eventInterface): NavigationCurrentEntryChangeEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "NavigationCurrentEntryChangeEvent" |
Returns
NavigationCurrentEntryChangeEvent
Call Signature
createEvent(eventInterface): OfflineAudioCompletionEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "OfflineAudioCompletionEvent" |
Returns
Call Signature
createEvent(eventInterface): PageRevealEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "PageRevealEvent" |
Returns
Call Signature
createEvent(eventInterface): PageSwapEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "PageSwapEvent" |
Returns
Call Signature
createEvent(eventInterface): PageTransitionEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "PageTransitionEvent" |
Returns
Call Signature
createEvent(eventInterface): PaymentMethodChangeEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "PaymentMethodChangeEvent" |
Returns
Call Signature
createEvent(eventInterface): PaymentRequestUpdateEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "PaymentRequestUpdateEvent" |
Returns
Call Signature
createEvent(eventInterface): PictureInPictureEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "PictureInPictureEvent" |
Returns
Call Signature
createEvent(eventInterface): PointerEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "PointerEvent" |
Returns
Call Signature
createEvent(eventInterface): PopStateEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "PopStateEvent" |
Returns
Call Signature
createEvent(eventInterface): ProgressEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "ProgressEvent" |
Returns
Call Signature
createEvent(eventInterface): PromiseRejectionEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "PromiseRejectionEvent" |
Returns
Call Signature
createEvent(eventInterface): RTCDTMFToneChangeEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "RTCDTMFToneChangeEvent" |
Returns
Call Signature
createEvent(eventInterface): RTCDataChannelEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "RTCDataChannelEvent" |
Returns
Call Signature
createEvent(eventInterface): RTCErrorEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "RTCErrorEvent" |
Returns
Call Signature
createEvent(eventInterface): RTCPeerConnectionIceErrorEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "RTCPeerConnectionIceErrorEvent" |
Returns
RTCPeerConnectionIceErrorEvent
Call Signature
createEvent(eventInterface): RTCPeerConnectionIceEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "RTCPeerConnectionIceEvent" |
Returns
Call Signature
createEvent(eventInterface): RTCTrackEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "RTCTrackEvent" |
Returns
Call Signature
createEvent(eventInterface): SecurityPolicyViolationEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "SecurityPolicyViolationEvent" |
Returns
Call Signature
createEvent(eventInterface): SpeechRecognitionErrorEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "SpeechRecognitionErrorEvent" |
Returns
Call Signature
createEvent(eventInterface): SpeechRecognitionEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "SpeechRecognitionEvent" |
Returns
Call Signature
createEvent(eventInterface): SpeechSynthesisErrorEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "SpeechSynthesisErrorEvent" |
Returns
Call Signature
createEvent(eventInterface): SpeechSynthesisEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "SpeechSynthesisEvent" |
Returns
Call Signature
createEvent(eventInterface): StorageEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "StorageEvent" |
Returns
Call Signature
createEvent(eventInterface): SubmitEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "SubmitEvent" |
Returns
Call Signature
createEvent(eventInterface): TaskPriorityChangeEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "TaskPriorityChangeEvent" |
Returns
Call Signature
createEvent(eventInterface): TextEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "TextEvent" |
Returns
Call Signature
createEvent(eventInterface): ToggleEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "ToggleEvent" |
Returns
Call Signature
createEvent(eventInterface): TouchEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "TouchEvent" |
Returns
Call Signature
createEvent(eventInterface): TrackEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "TrackEvent" |
Returns
Call Signature
createEvent(eventInterface): TransitionEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "TransitionEvent" |
Returns
Call Signature
createEvent(eventInterface): UIEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "UIEvent" |
Returns
Call Signature
createEvent(eventInterface): UIEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "UIEvents" |
Returns
Call Signature
createEvent(eventInterface): WebGLContextEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "WebGLContextEvent" |
Returns
Call Signature
createEvent(eventInterface): WheelEvent;
Parameters
| Parameter | Type |
|---|---|
eventInterface | "WheelEvent" |
Returns
Call Signature
createEvent(eventInterface): Event;
Parameters
| Parameter | Type |
|---|---|
eventInterface | string |
Returns
createExpression()
createExpression(expression, resolver?): XPathExpression;
Parameters
| Parameter | Type |
|---|---|
expression | string |
resolver? | XPathNSResolver | null |
Returns
Inherited from
XPathEvaluatorBase.createExpression
createNodeIterator()
createNodeIterator(
root,
whatToShow?,
filter?
): NodeIterator;
The Document.createNodeIterator() method returns a new NodeIterator object.
Parameters
| Parameter | Type |
|---|---|
root | Node |
whatToShow? | number |
filter? | NodeFilter | null |
Returns
createNSResolver()
createNSResolver(nodeResolver): Node;
Parameters
| Parameter | Type |
|---|---|
nodeResolver | Node |
Returns
Deprecated
Inherited from
XPathEvaluatorBase.createNSResolver
createProcessingInstruction()
createProcessingInstruction(target, data): ProcessingInstruction;
createProcessingInstruction() generates a new processing instruction node and returns it.
Parameters
| Parameter | Type |
|---|---|
target | string |
data | string |
Returns
createRange()
createRange(): Range;
The Document.createRange() method returns a new Range object whose start and end are offset 0 of the Document object on which it was called.
Returns
createTextNode()
createTextNode(data): Text;
Creates a new Text node. This method can be used to escape HTML characters.
Parameters
| Parameter | Type |
|---|---|
data | string |
Returns
createTreeWalker()
createTreeWalker(
root,
whatToShow?,
filter?
): TreeWalker;
The Document.createTreeWalker() creator method returns a newly created TreeWalker object.
Parameters
| Parameter | Type |
|---|---|
root | Node |
whatToShow? | number |
filter? | NodeFilter | null |
Returns
dispatchEvent()
dispatchEvent(event): boolean;
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
Parameters
| Parameter | Type |
|---|---|
event | Event |
Returns
boolean
Inherited from
elementFromPoint()
elementFromPoint(x, y): Element | null;
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
Returns
Element | null
Inherited from
DocumentOrShadowRoot.elementFromPoint
elementsFromPoint()
elementsFromPoint(x, y): Element[];
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
Returns
Element[]
Inherited from
DocumentOrShadowRoot.elementsFromPoint
evaluate()
evaluate(
expression,
contextNode,
resolver?,
type?,
result?
): XPathResult;
Parameters
| Parameter | Type |
|---|---|
expression | string |
contextNode | Node |
resolver? | XPathNSResolver | null |
type? | number |
result? | XPathResult | null |
Returns
Inherited from
execCommand()
execCommand(
commandId,
showUI?,
value?
): boolean;
The execCommand method implements multiple different commands. Some of them provide access to the clipboard, while others are for editing form inputs, contenteditable elements or entire documents (when switched to design mode).
Parameters
| Parameter | Type |
|---|---|
commandId | string |
showUI? | boolean |
value? | string |
Returns
boolean
Deprecated
exitFullscreen()
exitFullscreen(): Promise<void>;
The Document method exitFullscreen() requests that the element on this document which is currently being presented in fullscreen mode be taken out of fullscreen mode, restoring the previous state of the screen. This usually reverses the effects of a previous call to Element.requestFullscreen().
Returns
Promise<void>
exitPictureInPicture()
exitPictureInPicture(): Promise<void>;
The exitPictureInPicture() method of the Document interface requests that a video contained in this document, which is currently floating, be taken out of picture-in-picture mode, restoring the previous state of the screen. This usually reverses the effects of a previous call to HTMLVideoElement.requestPictureInPicture().
Returns
Promise<void>
exitPointerLock()
exitPointerLock(): void;
The exitPointerLock() method of the Document interface asynchronously releases a pointer lock previously requested through Element.requestPointerLock.
Returns
void
getAnimations()
getAnimations(): Animation[];
Returns
Inherited from
DocumentOrShadowRoot.getAnimations
getElementById()
getElementById(elementId): HTMLElement | null;
The getElementById() method of the Document interface returns an Element object representing the element whose id property matches the specified string. Since element IDs are required to be unique if specified, they're a useful way to get access to a specific element quickly.
Parameters
| Parameter | Type |
|---|---|
elementId | string |
Returns
HTMLElement | null
Overrides
NonElementParentNode.getElementById
getElementsByClassName()
getElementsByClassName(classNames): HTMLCollectionOf<Element>;
The getElementsByClassName method of Document interface returns an array-like object of all child elements which have all of the given class name(s).
Parameters
| Parameter | Type |
|---|---|
classNames | string |
Returns
getElementsByName()
getElementsByName(elementName): NodeListOf<HTMLElement>;
The getElementsByName() method of the Document object returns a NodeList Collection of elements with a given name attribute in the document.
Parameters
| Parameter | Type |
|---|---|
elementName | string |
Returns
getElementsByTagName()
Call Signature
getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
The getElementsByTagName method of Document interface returns an HTMLCollection of elements with the given tag name.
Type Parameters
| Type Parameter |
|---|
K extends keyof HTMLElementTagNameMap |
Parameters
| Parameter | Type |
|---|---|
qualifiedName | K |
Returns
HTMLCollectionOf<HTMLElementTagNameMap[K]>
Call Signature
getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<SVGElementTagNameMap[K]>;
Type Parameters
| Type Parameter |
|---|
K extends keyof SVGElementTagNameMap |
Parameters
| Parameter | Type |
|---|---|
qualifiedName | K |
Returns
HTMLCollectionOf<SVGElementTagNameMap[K]>
Call Signature
getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<MathMLElementTagNameMap[K]>;
Type Parameters
| Type Parameter |
|---|
K extends keyof MathMLElementTagNameMap |
Parameters
| Parameter | Type |
|---|---|
qualifiedName | K |
Returns
HTMLCollectionOf<MathMLElementTagNameMap[K]>
Call Signature
getElementsByTagName<K>(qualifiedName): HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>;
Type Parameters
| Type Parameter |
|---|
K extends keyof HTMLElementDeprecatedTagNameMap |
Parameters
| Parameter | Type |
|---|---|
qualifiedName | K |
Returns
HTMLCollectionOf<HTMLElementDeprecatedTagNameMap[K]>
Deprecated
Call Signature
getElementsByTagName(qualifiedName): HTMLCollectionOf<Element>;
Parameters
| Parameter | Type |
|---|---|
qualifiedName | string |
Returns
getElementsByTagNameNS()
Call Signature
getElementsByTagNameNS(namespaceURI, localName): HTMLCollectionOf<HTMLElement>;
Returns a list of elements with the given tag name belonging to the given namespace. The complete document is searched, including the root node.
Parameters
| Parameter | Type |
|---|---|
namespaceURI | "http://www.w3.org/1999/xhtml" |
localName | string |
Returns
Call Signature
getElementsByTagNameNS(namespaceURI, localName): HTMLCollectionOf<SVGElement>;
Parameters
| Parameter | Type |
|---|---|
namespaceURI | "http://www.w3.org/2000/svg" |
localName | string |
Returns
Call Signature
getElementsByTagNameNS(namespaceURI, localName): HTMLCollectionOf<MathMLElement>;
Parameters
| Parameter | Type |
|---|---|
namespaceURI | "http://www.w3.org/1998/Math/MathML" |
localName | string |
Returns
HTMLCollectionOf<MathMLElement>
Call Signature
getElementsByTagNameNS(namespace, localName): HTMLCollectionOf<Element>;
Parameters
| Parameter | Type |
|---|---|
namespace | string | null |
localName | string |
Returns
getRootNode()
getRootNode(options?): Node;
The getRootNode() method of the Node interface returns the context object's root, which optionally includes the shadow root if it is available.
Parameters
| Parameter | Type |
|---|---|
options? | GetRootNodeOptions |
Returns
Inherited from
getSelection()
getSelection(): Selection | null;
The getSelection() method of the Document interface returns the Selection object associated with this document, representing the range of text selected by the user, or the current position of the caret.
Returns
Selection | null
hasChildNodes()
hasChildNodes(): boolean;
The hasChildNodes() method of the Node interface returns a boolean value indicating whether the given Node has child nodes or not.
Returns
boolean
Inherited from
hasFocus()
hasFocus(): boolean;
The hasFocus() method of the Document interface returns a boolean value indicating whether the document or any element inside the document has focus. This method can be used to determine whether the active element in a document has focus.
Returns
boolean
hasStorageAccess()
hasStorageAccess(): Promise<boolean>;
The hasStorageAccess() method of the Document interface returns a Promise that resolves with a boolean value indicating whether the document has access to third-party, unpartitioned cookies.
Returns
Promise<boolean>
importNode()
importNode<T>(node, options?): T;
The importNode() method of the Document interface creates a copy of a Node or DocumentFragment from another document, to be inserted into the current document later.
Type Parameters
| Type Parameter |
|---|
T extends Node |
Parameters
| Parameter | Type |
|---|---|
node | T |
options? | boolean | ImportNodeOptions |
Returns
T
insertBefore()
insertBefore<T>(node, child): T;
The insertBefore() method of the Node interface inserts a node before a reference node as a child of a specified parent node.
Type Parameters
| Type Parameter |
|---|
T extends Node |
Parameters
| Parameter | Type |
|---|---|
node | T |
child | Node | null |
Returns
T
Inherited from
isDefaultNamespace()
isDefaultNamespace(namespace): boolean;
The isDefaultNamespace() method of the Node interface accepts a namespace URI as an argument. It returns a boolean value that is true if the namespace is the default namespace on the given node and false if not. The default namespace can be retrieved with Node.lookupNamespaceURI() by passing null as the argument.
Parameters
| Parameter | Type |
|---|---|
namespace | string | null |
Returns
boolean
Inherited from
isEqualNode()
isEqualNode(otherNode): boolean;
The isEqualNode() method of the Node interface tests whether two nodes are equal. Two nodes are equal when they have the same type, defining characteristics (for elements, this would be their ID, number of children, and so forth), its attributes match, and so on. The specific set of data points that must match varies depending on the types of the nodes.
Parameters
| Parameter | Type |
|---|---|
otherNode | Node | null |
Returns
boolean
Inherited from
isSameNode()
isSameNode(otherNode): boolean;
The isSameNode() method of the Node interface is a legacy alias the for the === strict equality operator. That is, it tests whether two nodes are the same (in other words, whether they reference the same object).
Parameters
| Parameter | Type |
|---|---|
otherNode | Node | null |
Returns
boolean
Inherited from
lookupNamespaceURI()
lookupNamespaceURI(prefix): string | null;
The lookupNamespaceURI() method of the Node interface takes a prefix as parameter and returns the namespace URI associated with it on the given node if found (and null if not). This method's existence allows Node objects to be passed as a namespace resolver to XPathEvaluator.createExpression() and XPathEvaluator.evaluate().
Parameters
| Parameter | Type |
|---|---|
prefix | string | null |
Returns
string | null
Inherited from
lookupPrefix()
lookupPrefix(namespace): string | null;
The lookupPrefix() method of the Node interface returns a string containing the prefix for a given namespace URI, if present, and null if not. When multiple prefixes are possible, the first prefix is returned.
Parameters
| Parameter | Type |
|---|---|
namespace | string | null |
Returns
string | null
Inherited from
moveBefore()
moveBefore(node, child): void;
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | Node | null |
Returns
void
Inherited from
normalize()
normalize(): void;
The normalize() method of the Node interface puts the specified node and all of its sub-tree into a normalized form. In a normalized sub-tree, no text nodes in the sub-tree are empty and there are no adjacent text nodes.
Returns
void
Inherited from
open()
Call Signature
open(unused1?, unused2?): Document;
The Document.open() method opens a document for writing.
Parameters
| Parameter | Type |
|---|---|
unused1? | string |
unused2? | string |
Returns
Document
Call Signature
open(
url,
name,
features
): Window | null;
Parameters
| Parameter | Type |
|---|---|
url | string | URL |
name | string |
features | string |
Returns
Window | null
prepend()
prepend(...nodes): void;
Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
Parameters
| Parameter | Type |
|---|---|
...nodes | (string | Node)[] |
Returns
void
Inherited from
queryCommandEnabled()
queryCommandEnabled(commandId): boolean;
The Document.queryCommandEnabled() method reports whether or not the specified editor command is enabled by the browser.
Parameters
| Parameter | Type |
|---|---|
commandId | string |
Returns
boolean
Deprecated
queryCommandIndeterm()
queryCommandIndeterm(commandId): boolean;
Parameters
| Parameter | Type |
|---|---|
commandId | string |
Returns
boolean
Deprecated
queryCommandState()
queryCommandState(commandId): boolean;
The queryCommandState() method will tell you if the current selection has a certain Document.execCommand() command applied.
Parameters
| Parameter | Type |
|---|---|
commandId | string |
Returns
boolean
Deprecated
queryCommandSupported()
queryCommandSupported(commandId): boolean;
The Document.queryCommandSupported() method reports whether or not the specified editor command is supported by the browser.
Parameters
| Parameter | Type |
|---|---|
commandId | string |
Returns
boolean
Deprecated
queryCommandValue()
queryCommandValue(commandId): string;
Parameters
| Parameter | Type |
|---|---|
commandId | string |
Returns
string
Deprecated
querySelector()
Call Signature
querySelector<K>(selectors): HTMLElementTagNameMap[K] | null;
Returns the first element that is a descendant of node that matches selectors.
Type Parameters
| Type Parameter |
|---|
K extends keyof HTMLElementTagNameMap |
Parameters
| Parameter | Type |
|---|---|
selectors | K |
Returns
HTMLElementTagNameMap[K] | null
Inherited from
Call Signature
querySelector<K>(selectors): SVGElementTagNameMap[K] | null;
Type Parameters
| Type Parameter |
|---|
K extends keyof SVGElementTagNameMap |
Parameters
| Parameter | Type |
|---|---|
selectors | K |
Returns
SVGElementTagNameMap[K] | null
Inherited from
Call Signature
querySelector<K>(selectors): MathMLElementTagNameMap[K] | null;
Type Parameters
| Type Parameter |
|---|
K extends keyof MathMLElementTagNameMap |
Parameters
| Parameter | Type |
|---|---|
selectors | K |
Returns
MathMLElementTagNameMap[K] | null
Inherited from
Call Signature
querySelector<K>(selectors):
| HTMLElementDeprecatedTagNameMap[K]
| null;
Type Parameters
| Type Parameter |
|---|
K extends keyof HTMLElementDeprecatedTagNameMap |
Parameters
| Parameter | Type |
|---|---|
selectors | K |
Returns
| HTMLElementDeprecatedTagNameMap[K]
| null
Deprecated
Inherited from
Call Signature
querySelector<E>(selectors): E | null;
Type Parameters
| Type Parameter | Default type |
|---|---|
E extends Element | Element |
Parameters
| Parameter | Type |
|---|---|
selectors | string |
Returns
E | null
Inherited from
querySelectorAll()
Call Signature
querySelectorAll<K>(selectors): NodeListOf<HTMLElementTagNameMap[K]>;
Returns all element descendants of node that match selectors.
Type Parameters
| Type Parameter |
|---|
K extends keyof HTMLElementTagNameMap |
Parameters
| Parameter | Type |
|---|---|
selectors | K |
Returns
NodeListOf<HTMLElementTagNameMap[K]>
Inherited from
Call Signature
querySelectorAll<K>(selectors): NodeListOf<SVGElementTagNameMap[K]>;
Type Parameters
| Type Parameter |
|---|
K extends keyof SVGElementTagNameMap |
Parameters
| Parameter | Type |
|---|---|
selectors | K |
Returns
NodeListOf<SVGElementTagNameMap[K]>
Inherited from
Call Signature
querySelectorAll<K>(selectors): NodeListOf<MathMLElementTagNameMap[K]>;
Type Parameters
| Type Parameter |
|---|
K extends keyof MathMLElementTagNameMap |
Parameters
| Parameter | Type |
|---|---|
selectors | K |
Returns
NodeListOf<MathMLElementTagNameMap[K]>
Inherited from
Call Signature
querySelectorAll<K>(selectors): NodeListOf<HTMLElementDeprecatedTagNameMap[K]>;
Type Parameters
| Type Parameter |
|---|
K extends keyof HTMLElementDeprecatedTagNameMap |
Parameters
| Parameter | Type |
|---|---|
selectors | K |
Returns
NodeListOf<HTMLElementDeprecatedTagNameMap[K]>
Deprecated
Inherited from
Call Signature
querySelectorAll<E>(selectors): NodeListOf<E>;
Type Parameters
| Type Parameter | Default type |
|---|---|
E extends Element | Element |
Parameters
| Parameter | Type |
|---|---|
selectors | string |
Returns
NodeListOf<E>
Inherited from
releaseEvents()
releaseEvents(): void;
Returns
void
Deprecated
removeChild()
removeChild<T>(child): T;
The removeChild() method of the Node interface removes a child node from the DOM and returns the removed node.
Type Parameters
| Type Parameter |
|---|
T extends Node |
Parameters
| Parameter | Type |
|---|---|
child | T |
Returns
T
Inherited from
removeEventListener()
Call Signature
removeEventListener<K>(
type,
listener,
options?
): void;
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
Type Parameters
| Type Parameter |
|---|
K extends keyof DocumentEventMap |
Parameters
| Parameter | Type |
|---|---|
type | K |
listener | (this, ev) => any |
options? | boolean | EventListenerOptions |
Returns
void
Overrides
Call Signature
removeEventListener(
type,
listener,
options?
): void;
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
Parameters
| Parameter | Type |
|---|---|
type | string |
listener | EventListenerOrEventListenerObject |
options? | boolean | EventListenerOptions |
Returns
void
Overrides
GlobalEventHandlers.removeEventListener
replaceChild()
replaceChild<T>(node, child): T;
The replaceChild() method of the Node interface replaces a child node within the given (parent) node.
Type Parameters
| Type Parameter |
|---|
T extends Node |
Parameters
| Parameter | Type |
|---|---|
node | Node |
child | T |
Returns
T
Inherited from
replaceChildren()
replaceChildren(...nodes): void;
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
Parameters
| Parameter | Type |
|---|---|
...nodes | (string | Node)[] |
Returns
void
Inherited from
requestStorageAccess()
requestStorageAccess(): Promise<void>;
The requestStorageAccess() method of the Document interface allows content loaded in a third-party context (i.e., embedded in an <iframe>) to request access to third-party cookies and unpartitioned state. This is relevant to user agents that, by default, block access to third-party, unpartitioned cookies to improve privacy (e.g., to prevent tracking), and is part of the Storage Access API.
Returns
Promise<void>
startViewTransition()
startViewTransition(callbackOptions?): ViewTransition;
The startViewTransition() method of the Document interface starts a new same-document (SPA) view transition and returns a ViewTransition object to represent it.
Parameters
| Parameter | Type |
|---|---|
callbackOptions? | | ViewTransitionUpdateCallback | StartViewTransitionOptions |
Returns
write()
write(...text): void;
The write() method of the Document interface writes text in one or more TrustedHTML or string parameters to a document stream opened by document.open().
Parameters
| Parameter | Type |
|---|---|
...text | string[] |
Returns
void
Deprecated
writeln()
writeln(...text): void;
The writeln() method of the Document interface writes text in one or more TrustedHTML or string parameters to a document stream opened by document.open(), followed by a newline character.
Parameters
| Parameter | Type |
|---|---|
...text | string[] |
Returns
void
Deprecated
Properties
activeElement
readonly activeElement: Element | null;
Returns the deepest element in the document through which or to which key events are being routed. This is, roughly speaking, the focused element in the document.
For the purposes of this API, when a child browsing context is focused, its container is focused in the parent browsing context. For example, if the user moves the focus to a text control in an iframe, the iframe is the element returned by the activeElement API in the iframe's node document.
Similarly, when the focused element is in a different node tree than documentOrShadowRoot, the element returned will be the host that's located in the same node tree as documentOrShadowRoot if documentOrShadowRoot is a shadow-including inclusive ancestor of the focused element, and null if not.
Inherited from
DocumentOrShadowRoot.activeElement
activeViewTransition
readonly activeViewTransition: ViewTransition | null;
The activeViewTransition read-only property of the Document interface returns a ViewTransition instance representing the view transition currently active on the document.
adoptedStyleSheets
adoptedStyleSheets: CSSStyleSheet[];
Inherited from
DocumentOrShadowRoot.adoptedStyleSheets
alinkColor
alinkColor: string;
Returns or sets the color of an active link in the document body. A link is active during the time between mousedown and mouseup events.
Deprecated
all
readonly all: HTMLAllCollection;
The Document interface's read-only all property returns an HTMLAllCollection rooted at the document node.
Deprecated
anchors
readonly anchors: HTMLCollectionOf<HTMLAnchorElement>;
The anchors read-only property of the Document interface returns a list of all of the anchors in the document.
Deprecated
applets
readonly applets: HTMLCollection;
The applets property of the Document returns an empty HTMLCollection. This property is kept only for compatibility reasons; in older versions of browsers, it returned a list of the applets within a document.
Deprecated
ATTRIBUTE_NODE
readonly ATTRIBUTE_NODE: 2;
Inherited from
baseURI
readonly baseURI: string;
The read-only baseURI property of the Node interface returns the absolute base URL of the document containing the node.
Inherited from
bgColor
bgColor: string;
The deprecated bgColor property gets or sets the background color of the current document.
Deprecated
body
body: HTMLElement;
The Document.body property represents the <body> or <frameset> node of the current document, or null if no such element exists.
CDATA_SECTION_NODE
readonly CDATA_SECTION_NODE: 4;
node is a CDATASection node.
Inherited from
characterSet
readonly characterSet: string;
The Document.characterSet read-only property returns the character encoding of the document that it's currently rendered with.
charset
readonly charset: string;
Deprecated
This is a legacy alias of characterSet.
childElementCount
readonly childElementCount: number;
Inherited from
childNodes
readonly childNodes: NodeListOf<ChildNode>;
The read-only childNodes property of the Node interface returns a live NodeList of child nodes of the given element where the first child node is assigned index 0. Child nodes include elements, text and comments.
Inherited from
children
readonly children: HTMLCollection;
Returns the child elements.
Inherited from
COMMENT_NODE
readonly COMMENT_NODE: 8;
node is a Comment node.
Inherited from
compatMode
readonly compatMode: string;
The Document.compatMode read-only property indicates whether the document is rendered in Quirks mode or Standards mode.
contentType
readonly contentType: string;
The Document.contentType read-only property returns the MIME type that the document is being rendered as. This may come from HTTP headers or other sources of MIME information, and might be affected by automatic type conversions performed by either the browser or extensions.
cookie
cookie: string;
The Document property cookie lets you read and write cookies associated with the document. It serves as a getter and setter for the actual values of the cookies.
currentScript
readonly currentScript: HTMLOrSVGScriptElement | null;
The Document.currentScript property returns the <script> element whose script is currently being processed and isn't a JavaScript module. (For modules use import.meta instead.)
customElementRegistry
readonly customElementRegistry: CustomElementRegistry | null;
Inherited from
DocumentOrShadowRoot.customElementRegistry
defaultView
readonly defaultView: Window & typeof globalThis | null;
In browsers, document.defaultView returns the window object associated with a document, or null if none is available.
designMode
designMode: string;
document.designMode controls whether the entire document is editable. Valid values are "on" and "off". According to the specification, this property is meant to default to "off". Firefox follows this standard. The earlier versions of Chrome and IE default to "inherit". Starting in Chrome 43, the default is "off" and "inherit" is no longer supported. In IE6-10, the value is capitalized.
dir
dir: string;
The Document.dir property is a string representing the directionality of the text of the document, whether left to right (default) or right to left. Possible values are 'rtl', right to left, and 'ltr', left to right.
doctype
readonly doctype: DocumentType | null;
The doctype read-only property of the Document interface is a DocumentType object representing the Document Type Declaration (DTD) associated with the current document.
DOCUMENT_FRAGMENT_NODE
readonly DOCUMENT_FRAGMENT_NODE: 11;
node is a DocumentFragment node.
Inherited from
DOCUMENT_NODE
readonly DOCUMENT_NODE: 9;
node is a document.
Inherited from
DOCUMENT_POSITION_CONTAINED_BY
readonly DOCUMENT_POSITION_CONTAINED_BY: 16;
Set when other is a descendant of node.
Inherited from
Node.DOCUMENT_POSITION_CONTAINED_BY
DOCUMENT_POSITION_CONTAINS
readonly DOCUMENT_POSITION_CONTAINS: 8;
Set when other is an ancestor of node.
Inherited from
Node.DOCUMENT_POSITION_CONTAINS
DOCUMENT_POSITION_DISCONNECTED
readonly DOCUMENT_POSITION_DISCONNECTED: 1;
Set when node and other are not in the same tree.
Inherited from
Node.DOCUMENT_POSITION_DISCONNECTED
DOCUMENT_POSITION_FOLLOWING
readonly DOCUMENT_POSITION_FOLLOWING: 4;
Set when other is following node.
Inherited from
Node.DOCUMENT_POSITION_FOLLOWING
DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: 32;
Inherited from
Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC
DOCUMENT_POSITION_PRECEDING
readonly DOCUMENT_POSITION_PRECEDING: 2;
Set when other is preceding node.
Inherited from
Node.DOCUMENT_POSITION_PRECEDING
DOCUMENT_TYPE_NODE
readonly DOCUMENT_TYPE_NODE: 10;
node is a doctype.
Inherited from
documentElement
readonly documentElement: HTMLElement;
The documentElement read-only property of the Document interface returns the Element that is the root element of the document (for example, the <html> element for HTML documents).
documentURI
readonly documentURI: string;
The documentURI read-only property of the Document interface returns the document location as a string.
domain
domain: string;
The domain property of the Document interface gets/sets the domain portion of the origin of the current document, as used by the same-origin policy.
Deprecated
ELEMENT_NODE
readonly ELEMENT_NODE: 1;
node is an element.
Inherited from
embeds
readonly embeds: HTMLCollectionOf<HTMLEmbedElement>;
The embeds read-only property of the Document interface returns a list of the embedded <embed> elements within the current document.
ENTITY_NODE
readonly ENTITY_NODE: 6;
Inherited from
ENTITY_REFERENCE_NODE
readonly ENTITY_REFERENCE_NODE: 5;
Inherited from
fgColor
fgColor: string;
fgColor gets/sets the foreground color, or text color, of the current document.
Deprecated
firstChild
readonly firstChild: ChildNode | null;
The read-only firstChild property of the Node interface returns the node's first child in the tree, or null if the node has no children.
Inherited from
firstElementChild
readonly firstElementChild: Element | null;
Returns the first child that is an element, and null otherwise.
Inherited from
fonts
readonly fonts: FontFaceSet;
Inherited from
forms
readonly forms: HTMLCollectionOf<HTMLFormElement>;
The forms read-only property of the Document interface returns an HTMLCollection listing all the <form> elements contained in the document.
fragmentDirective
readonly fragmentDirective: FragmentDirective;
The fragmentDirective read-only property of the Document interface returns the FragmentDirective for the current document.
fullscreen
readonly fullscreen: boolean;
The obsolete Document interface's fullscreen read-only property reports whether or not the document is currently displaying content in fullscreen mode.
Deprecated
fullscreenElement
readonly fullscreenElement: Element | null;
Returns document's fullscreen element.
Inherited from
DocumentOrShadowRoot.fullscreenElement
fullscreenEnabled
readonly fullscreenEnabled: boolean;
The read-only fullscreenEnabled property on the Document interface indicates whether or not fullscreen mode is available.
head
readonly head: HTMLHeadElement;
The head read-only property of the Document interface returns the <head> element of the current document.
hidden
readonly hidden: boolean;
The Document.hidden read-only property returns a Boolean value indicating if the page is considered hidden or not.
images
readonly images: HTMLCollectionOf<HTMLImageElement>;
The images read-only property of the Document interface returns a collection of the images in the current HTML document.
implementation
readonly implementation: DOMImplementation;
The Document.implementation property returns a DOMImplementation object associated with the current document.
inputEncoding
readonly inputEncoding: string;
Deprecated
This is a legacy alias of characterSet.
isConnected
readonly isConnected: boolean;
The read-only isConnected property of the Node interface returns a boolean indicating whether the node is connected (directly or indirectly) to a Document object.
Inherited from
lastChild
readonly lastChild: ChildNode | null;
The read-only lastChild property of the Node interface returns the last child of the node, or null if there are no child nodes.
Inherited from
lastElementChild
readonly lastElementChild: Element | null;
Returns the last child that is an element, and null otherwise.
Inherited from
lastModified
readonly lastModified: string;
The lastModified property of the Document interface returns a string containing the date and local time on which the current document was last modified.
linkColor
linkColor: string;
The Document.linkColor property gets/sets the color of links within the document.
Deprecated
links
readonly links: HTMLCollectionOf<
| HTMLAnchorElement
| HTMLAreaElement>;
The links read-only property of the Document interface returns a collection of all <area> elements and <a> elements in a document with a value for the href attribute.
nextSibling
readonly nextSibling: ChildNode | null;
The read-only nextSibling property of the Node interface returns the node immediately following the specified one in their parent's childNodes, or returns null if the specified node is the last child in the parent element.
Inherited from
nodeName
readonly nodeName: string;
The read-only nodeName property of Node returns the name of the current node as a string.
Inherited from
nodeType
readonly nodeType: number;
The read-only nodeType property of a Node interface is an integer that identifies what the node is. It distinguishes different kinds of nodes from each other, such as elements, text, and comments.
Inherited from
nodeValue
nodeValue: string | null;
The nodeValue property of the Node interface returns or sets the value of the current node.
Inherited from
NOTATION_NODE
readonly NOTATION_NODE: 12;
Inherited from
onabort
onabort: ((this, ev) => any) | null;
Inherited from
onanimationcancel
onanimationcancel: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onanimationcancel
onanimationend
onanimationend: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onanimationend
onanimationiteration
onanimationiteration: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onanimationiteration
onanimationstart
onanimationstart: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onanimationstart
onauxclick
onauxclick: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onauxclick
onbeforeinput
onbeforeinput: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onbeforeinput
onbeforematch
onbeforematch: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onbeforematch
onbeforetoggle
onbeforetoggle: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onbeforetoggle
onblur
onblur: ((this, ev) => any) | null;
Inherited from
oncancel
oncancel: ((this, ev) => any) | null;
Inherited from
oncanplay
oncanplay: ((this, ev) => any) | null;
Inherited from
oncanplaythrough
oncanplaythrough: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.oncanplaythrough
onchange
onchange: ((this, ev) => any) | null;
Inherited from
onclick
onclick: ((this, ev) => any) | null;
Inherited from
onclose
onclose: ((this, ev) => any) | null;
Inherited from
oncommand
oncommand: ((this, ev) => any) | null;
Inherited from
oncontextlost
oncontextlost: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.oncontextlost
oncontextmenu
oncontextmenu: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.oncontextmenu
oncontextrestored
oncontextrestored: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.oncontextrestored
oncopy
oncopy: ((this, ev) => any) | null;
Inherited from
oncuechange
oncuechange: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.oncuechange
oncut
oncut: ((this, ev) => any) | null;
Inherited from
ondblclick
ondblclick: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ondblclick
ondrag
ondrag: ((this, ev) => any) | null;
Inherited from
ondragend
ondragend: ((this, ev) => any) | null;
Inherited from
ondragenter
ondragenter: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ondragenter
ondragleave
ondragleave: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ondragleave
ondragover
ondragover: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ondragover
ondragstart
ondragstart: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ondragstart
ondrop
ondrop: ((this, ev) => any) | null;
Inherited from
ondurationchange
ondurationchange: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ondurationchange
onemptied
onemptied: ((this, ev) => any) | null;
Inherited from
onended
onended: ((this, ev) => any) | null;
Inherited from
onerror
onerror: OnErrorEventHandler;
Inherited from
onfocus
onfocus: ((this, ev) => any) | null;
Inherited from
onformdata
onformdata: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onformdata
onfullscreenchange
onfullscreenchange: ((this, ev) => any) | null;
onfullscreenerror
onfullscreenerror: ((this, ev) => any) | null;
ongotpointercapture
ongotpointercapture: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ongotpointercapture
oninput
oninput: ((this, ev) => any) | null;
Inherited from
oninvalid
oninvalid: ((this, ev) => any) | null;
Inherited from
onkeydown
onkeydown: ((this, ev) => any) | null;
Inherited from
onkeypress
onkeypress: ((this, ev) => any) | null;
Deprecated
Inherited from
GlobalEventHandlers.onkeypress
onkeyup
onkeyup: ((this, ev) => any) | null;
Inherited from
onload
onload: ((this, ev) => any) | null;
Inherited from
onloadeddata
onloadeddata: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onloadeddata
onloadedmetadata
onloadedmetadata: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onloadedmetadata
onloadstart
onloadstart: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onloadstart
onlostpointercapture
onlostpointercapture: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onlostpointercapture
onmousedown
onmousedown: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onmousedown
onmouseenter
onmouseenter: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onmouseenter
onmouseleave
onmouseleave: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onmouseleave
onmousemove
onmousemove: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onmousemove
onmouseout
onmouseout: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onmouseout
onmouseover
onmouseover: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onmouseover
onmouseup
onmouseup: ((this, ev) => any) | null;
Inherited from
onpaste
onpaste: ((this, ev) => any) | null;
Inherited from
onpause
onpause: ((this, ev) => any) | null;
Inherited from
onplay
onplay: ((this, ev) => any) | null;
Inherited from
onplaying
onplaying: ((this, ev) => any) | null;
Inherited from
onpointercancel
onpointercancel: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onpointercancel
onpointerdown
onpointerdown: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onpointerdown
onpointerenter
onpointerenter: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onpointerenter
onpointerleave
onpointerleave: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onpointerleave
onpointerlockchange
onpointerlockchange: ((this, ev) => any) | null;
onpointerlockerror
onpointerlockerror: ((this, ev) => any) | null;
onpointermove
onpointermove: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onpointermove
onpointerout
onpointerout: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onpointerout
onpointerover
onpointerover: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onpointerover
onpointerrawupdate
onpointerrawupdate: ((this, ev) => any) | null;
Available only in secure contexts.
Inherited from
GlobalEventHandlers.onpointerrawupdate
onpointerup
onpointerup: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onpointerup
onprogress
onprogress: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onprogress
onratechange
onratechange: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onratechange
onreadystatechange
onreadystatechange: ((this, ev) => any) | null;
onreset
onreset: ((this, ev) => any) | null;
Inherited from
onresize
onresize: ((this, ev) => any) | null;
Inherited from
onscroll
onscroll: ((this, ev) => any) | null;
Inherited from
onscrollend
onscrollend: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onscrollend
onsecuritypolicyviolation
onsecuritypolicyviolation: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onsecuritypolicyviolation
onseeked
onseeked: ((this, ev) => any) | null;
Inherited from
onseeking
onseeking: ((this, ev) => any) | null;
Inherited from
onselect
onselect: ((this, ev) => any) | null;
Inherited from
onselectionchange
onselectionchange: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onselectionchange
onselectstart
onselectstart: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onselectstart
onslotchange
onslotchange: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onslotchange
onstalled
onstalled: ((this, ev) => any) | null;
Inherited from
onsubmit
onsubmit: ((this, ev) => any) | null;
Inherited from
onsuspend
onsuspend: ((this, ev) => any) | null;
Inherited from
ontimeupdate
ontimeupdate: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ontimeupdate
ontoggle
ontoggle: ((this, ev) => any) | null;
Inherited from
ontouchcancel?
optional ontouchcancel?: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ontouchcancel
ontouchend?
optional ontouchend?: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ontouchend
ontouchmove?
optional ontouchmove?: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ontouchmove
ontouchstart?
optional ontouchstart?: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ontouchstart
ontransitioncancel
ontransitioncancel: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ontransitioncancel
ontransitionend
ontransitionend: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ontransitionend
ontransitionrun
ontransitionrun: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ontransitionrun
ontransitionstart
ontransitionstart: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.ontransitionstart
onvisibilitychange
onvisibilitychange: ((this, ev) => any) | null;
onvolumechange
onvolumechange: ((this, ev) => any) | null;
Inherited from
GlobalEventHandlers.onvolumechange
onwaiting
onwaiting: ((this, ev) => any) | null;
Inherited from
onwebkitanimationend
onwebkitanimationend: ((this, ev) => any) | null;
Deprecated
This is a legacy alias of onanimationend.
Inherited from
GlobalEventHandlers.onwebkitanimationend
onwebkitanimationiteration
onwebkitanimationiteration: ((this, ev) => any) | null;
Deprecated
This is a legacy alias of onanimationiteration.
Inherited from
GlobalEventHandlers.onwebkitanimationiteration
onwebkitanimationstart
onwebkitanimationstart: ((this, ev) => any) | null;
Deprecated
This is a legacy alias of onanimationstart.
Inherited from
GlobalEventHandlers.onwebkitanimationstart
onwebkittransitionend
onwebkittransitionend: ((this, ev) => any) | null;
Deprecated
This is a legacy alias of ontransitionend.
Inherited from
GlobalEventHandlers.onwebkittransitionend
onwheel
onwheel: ((this, ev) => any) | null;
Inherited from
ownerDocument
readonly ownerDocument: null;
The read-only ownerDocument property of the Node interface returns the top-level document object of the node.
Overrides
parentElement
readonly parentElement: HTMLElement | null;
The read-only parentElement property of Node interface returns the DOM node's parent Element, or null if the node either has no parent, or its parent isn't a DOM Element. Node.parentNode on the other hand returns any kind of parent, regardless of its type.
Inherited from
parentNode
readonly parentNode: ParentNode | null;
The read-only parentNode property of the Node interface returns the parent of the specified node in the DOM tree.
Inherited from
pictureInPictureElement
readonly pictureInPictureElement: Element | null;
Inherited from
DocumentOrShadowRoot.pictureInPictureElement
pictureInPictureEnabled
readonly pictureInPictureEnabled: boolean;
The read-only pictureInPictureEnabled property of the Document interface indicates whether or not picture-in-picture mode is available.
plugins
readonly plugins: HTMLCollectionOf<HTMLEmbedElement>;
The plugins read-only property of the Document interface returns an HTMLCollection object containing one or more HTMLEmbedElements representing the <embed> elements in the current document.
pointerLockElement
readonly pointerLockElement: Element | null;
Inherited from
DocumentOrShadowRoot.pointerLockElement
previousSibling
readonly previousSibling: ChildNode | null;
The read-only previousSibling property of the Node interface returns the node immediately preceding the specified one in its parent's childNodes list, or null if the specified node is the first in that list.
Inherited from
PROCESSING_INSTRUCTION_NODE
readonly PROCESSING_INSTRUCTION_NODE: 7;
node is a ProcessingInstruction node.
Inherited from
Node.PROCESSING_INSTRUCTION_NODE
readyState
readonly readyState: DocumentReadyState;
The Document.readyState property describes the loading state of the document. When the value of this property changes, a readystatechange event fires on the document object.
referrer
readonly referrer: string;
The Document.referrer property returns the URI of the page that linked to this page.
rootElement
readonly rootElement: SVGSVGElement | null;
Document.rootElement returns the Element that is the root element of the document if it is an <svg> element, otherwise null. It is deprecated in favor of Document.documentElement, which returns the root element for all documents.
Deprecated
scripts
readonly scripts: HTMLCollectionOf<HTMLScriptElement>;
The scripts property of the Document interface returns a list of the <script> elements in the document. The returned object is an HTMLCollection.
scrollingElement
readonly scrollingElement: Element | null;
The scrollingElement read-only property of the Document interface returns a reference to the Element that scrolls the document. In standards mode, this is the root element of the document, document.documentElement.
styleSheets
readonly styleSheets: StyleSheetList;
Inherited from
DocumentOrShadowRoot.styleSheets
TEXT_NODE
readonly TEXT_NODE: 3;
node is a Text node.
Inherited from
timeline
readonly timeline: DocumentTimeline;
The timeline readonly property of the Document interface represents the default timeline of the current document. This timeline is a special instance of DocumentTimeline.
title
title: string;
The document.title property gets or sets the current title of the document. When present, it defaults to the value of the <title>.
URL
readonly URL: string;
The URL read-only property of the Document interface returns the document location as a string.
visibilityState
readonly visibilityState: DocumentVisibilityState;
The Document.visibilityState read-only property returns the visibility of the document. It can be used to check whether the document is in the background or in a minimized window, or is otherwise not visible to the user.
vlinkColor
vlinkColor: string;
The Document.vlinkColor property gets/sets the color of links that the user has visited in the document.