ReadonlyactiveReturns 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.
Sets or gets the color of all active links in the document.
ReadonlyallReturns a reference to the collection of elements contained by the object.
ReadonlyanchorsRetrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.
ReadonlyappletsRetrieves a collection of all applet objects in the document.
ReadonlyATTRIBUTE_ReadonlybaseReturns node's node document's document base URL.
Deprecated. Sets or retrieves a value that indicates the background color behind the object.
Specifies the beginning and end of the document body.
ReadonlyCDATA_node is a CDATASection node.
ReadonlycharacterReturns document's encoding.
ReadonlycharsetGets or sets the character set used to encode the object.
ReadonlychildReadonlychildReturns the children.
ReadonlychildrenReturns the child elements.
ReadonlyCOMMENT_node is a Comment node.
ReadonlycompatGets a value that indicates whether standards-compliant mode is switched on for the object.
ReadonlycontentReturns document's content type.
Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned.
Can be set, to add a new cookie to the element's set of HTTP cookies.
If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a "SecurityError" DOMException will be thrown on getting and setting.
ReadonlycurrentReturns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing.
Returns null if the Document is not currently executing a script or SVG script element (e.g., because the running script is an event handler, or a timeout), or if the currently executing script or SVG script element represents a module script.
ReadonlydefaultReturns the Window object of the active document.
Sets or gets a value that indicates whether the document can be edited.
Sets or retrieves a value that indicates the reading order of the object.
ReadonlydoctypeGets an object representing the document type declaration associated with the current document.
ReadonlyDOCUMENT_node is a DocumentFragment node.
ReadonlyDOCUMENT_node is a document.
ReadonlyDOCUMENT_Set when other is a descendant of node.
ReadonlyDOCUMENT_Set when other is an ancestor of node.
ReadonlyDOCUMENT_Set when node and other are not in the same tree.
ReadonlyDOCUMENT_Set when other is following node.
ReadonlyDOCUMENT_ReadonlyDOCUMENT_Set when other is preceding node.
ReadonlyDOCUMENT_node is a doctype.
ReadonlydocumentGets a reference to the root node of the document.
ReadonlydocumentReturns document's URL.
Sets or gets the security domain of the document.
ReadonlyELEMENT_node is an element.
ReadonlyembedsRetrieves a collection of all embed objects in the document.
ReadonlyENTITY_ReadonlyENTITY_Sets or gets the foreground (text) color of the document.
ReadonlyfirstReturns the first child.
ReadonlyfirstReturns the first child that is an element, and null otherwise.
ReadonlyfontsReadonlyformsRetrieves a collection, in source order, of all form objects in the document.
ReadonlyfragmentReadonlyfullscreenReadonlyfullscreenReturns document's fullscreen element.
ReadonlyfullscreenReturns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.
ReadonlyheadReturns the head element.
ReadonlyhiddenReadonlyimagesRetrieves a collection, in source order, of img objects in the document.
ReadonlyimplementationGets the implementation object of the current document.
ReadonlyinputReturns the character encoding used to create the webpage that is loaded into the document object.
ReadonlyisReturns true if node is connected and false otherwise.
ReadonlylastReturns the last child.
ReadonlylastReturns the last child that is an element, and null otherwise.
ReadonlylastGets the date that the page was last modified, if the page supplies one.
Sets or gets the color of the document links.
ReadonlylinksRetrieves a collection of all a objects that specify the href property and all area objects in the document.
ReadonlynextReturns the next sibling.
ReadonlynodeReturns a string appropriate for the type of node.
ReadonlynodeReturns the type of node.
ReadonlyNOTATION_Fires when the user aborts the download.
The event.
Fires when the object loses the input focus.
The focus event.
Occurs when playback is possible, but would require further buffering.
The event.
Fires when the contents of the object or selection have changed.
The event.
Fires when the user clicks the left mouse button on the object
The mouse event.
Fires when the user clicks the right mouse button in the client area, opening the context menu.
The mouse event.
Fires when the user double-clicks the object.
The mouse event.
Fires on the source object continuously during a drag operation.
The event.
Fires on the source object when the user releases the mouse at the close of a drag operation.
The event.
Fires on the target element when the user drags the object to a valid drop target.
The drag event.
Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
The drag event.
Fires on the target element continuously while the user drags the object over a valid drop target.
The event.
Fires on the source object when the user starts to drag a text selection or selected object.
The event.
Occurs when the duration attribute is updated.
The event.
Occurs when the media element is reset to its initial state.
The event.
Occurs when the end of playback is reached.
The event
Fires when an error occurs during object loading.
Fires when the object receives focus.
The event.
Fires when the user presses a key.
The keyboard event
Fires when the user presses an alphanumeric key.
The event.
Fires when the user releases a key.
The keyboard event
Fires immediately after the browser loads the object.
The event.
Occurs when media data is loaded at the current playback position.
The event.
Occurs when the duration and dimensions of the media have been determined.
The event.
Occurs when Internet Explorer begins looking for media data.
The event.
Fires when the user clicks the object with either mouse button.
The mouse event.
Fires when the user moves the mouse over the object.
The mouse event.
Fires when the user moves the mouse pointer outside the boundaries of the object.
The mouse event.
Fires when the user moves the mouse pointer into the object.
The mouse event.
Fires when the user releases a mouse button while the mouse is over the object.
The mouse event.
Occurs when playback is paused.
The event.
Occurs when the play method is requested.
The event.
Occurs when the audio or video has started playing.
The event.
Occurs to indicate progress while downloading media data.
The event.
Occurs when the playback rate is increased or decreased.
The event.
Fires when the state of the object has changed.
Fires when the user resets a form.
The event.
Fires when the user repositions the scroll box in the scroll bar on the object.
The event.
Occurs when the seek operation ends.
The event.
Occurs when the current playback position is moved.
The event.
Fires when the current selection changes.
The event.
Occurs when the download has stopped.
The event.
Occurs if the load operation has been intentionally halted.
The event.
Occurs to indicate the current playback position.
The event.
OptionalontouchcancelOptionalontouchendOptionalontouchmoveOptionalontouchstartOccurs when the volume is changed, or playback is muted or unmuted.
The event.
Occurs when playback stops because the next frame of a video resource is not available.
The event.
ReadonlyownerReturns the node document. Returns null for documents.
ReadonlyparentReturns the parent element.
ReadonlyparentReturns the parent.
ReadonlypictureReadonlypictureReadonlypluginsReturn an HTMLCollection of the embed elements in the Document.
ReadonlypointerReadonlypreviousReturns the previous sibling.
ReadonlyPROCESSING_node is a ProcessingInstruction node.
ReadonlyreadyRetrieves a value that indicates the current state of the object.
ReadonlyreferrerGets the URL of the location that referred the user to the current page.
ReadonlyrootReadonlyscriptsRetrieves a collection of all script objects in the document.
ReadonlyscrollingReadonlystyleRetrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.
ReadonlyTEXT_node is a Text node.
ReadonlytimelineContains the title of the document.
ReadonlyURLSets or gets the URL for the current document.
ReadonlyvisibilitySets or gets the color of the links that the user has visited.
Contains information about the current URL.
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
Optionaloptions: boolean | AddEventListenerOptionsAppends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
Optionaloptions: boolean | AddEventListenerOptionsInserts 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.
Optionaloptions: CaretPositionFromPointOptionsReturns a copy of node. If deep is true, the copy also includes the node's descendants.
Optionalsubtree: booleanCloses an output stream and forces the sent data to display.
Returns a bitmask indicating the position of other relative to node.
Returns true if other is an inclusive descendant of node, and false otherwise.
Creates a comment object with the specified data.
Sets the comment object's data.
Creates a new document.
Creates an instance of the element for the specified tag.
The name of an element.
Optionaloptions: ElementCreationOptionsOptionaloptions: ElementCreationOptionsOptionaloptions: ElementCreationOptionsReturns an element with namespace namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName.
If localName does not match the Name production an "InvalidCharacterError" DOMException will be thrown.
If one of the following conditions is true a "NamespaceError" DOMException will be thrown:
localName does not match the QName production. Namespace prefix is not null and namespace is the empty string. Namespace prefix is "xml" and namespace is not the XML namespace. qualifiedName or namespace prefix is "xmlns" and namespace is not the XMLNS namespace. namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is "xmlns".
When supplied, options's is can be used to create a customized built-in element.
Optionaloptions: ElementCreationOptionsOptionaloptions: string | ElementCreationOptionsCreates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
The root element or node to start traversing on.
OptionalwhatToShow: numberThe type of nodes or elements to appear in the node list
Optionalfilter: NodeFilterA custom NodeFilter function to use. For more information, see filter. Use null for no filter.
Returns a ProcessingInstruction node whose target is target and data is data. If target does not match the Name production an "InvalidCharacterError" DOMException will be thrown. If data contains "?>" an "InvalidCharacterError" DOMException will be thrown.
Returns an empty range object that has both of its boundary points positioned at the beginning of the document.
Creates a text string from the specified value.
String that specifies the nodeValue property of the text node.
Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.
The root element or node to start traversing on.
OptionalwhatToShow: numberThe type of nodes or elements to appear in the node list. For more information, see whatToShow.
Optionalfilter: NodeFilterA custom NodeFilter function to use.
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
Returns the element for the specified x coordinate and the specified y coordinate.
The x-offset
The y-offset
Optionalresolver: XPathNSResolverOptionaltype: numberOptionalresult: XPathResultExecutes a command on the current document, current selection, or the given range.
String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
OptionalshowUI: booleanDisplay the user interface, defaults to false.
Optionalvalue: stringValue to assign.
Stops document's fullscreen element from being displayed fullscreen and resolves promise when done.
Returns a reference to the first object with the specified value of the ID attribute.
String that specifies the ID value.
Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
Gets a collection of objects based on the value of the NAME or ID attribute.
Gets a collection of objects based on the value of the NAME or ID attribute.
Retrieves a collection of objects based on the specified element name.
If namespace and localName are "*" returns a HTMLCollection of all descendant elements.
If only namespace is "*" returns a HTMLCollection of all descendant elements whose local name is localName.
If only localName is "*" returns a HTMLCollection of all descendant elements whose namespace is namespace.
Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName.
Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.
Returns whether node has children.
Gets a value indicating whether the object currently has focus.
Returns whether node and otherNode have the same properties.
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.
Optionalunused1: stringOptionalunused2: stringInserts 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.
Returns the first element that is a descendant of node that matches selectors.
Returns all element descendants of node that match selectors.
Removes the event listener in target's event listener list with the same type, callback, and options.
Optionaloptions: boolean | EventListenerOptionsRemoves the event listener in target's event listener list with the same type, callback, and options.
Optionaloptions: boolean | EventListenerOptionsReplace 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.
Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.
Any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree.
MDN Reference