Document
Values
addEventListener
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.Read more on MDN
letaddEventListener: (WebAPI.DOMAPI.document,WebAPI.EventAPI.eventType,WebAPI.EventAPI.eventListener<'event>,~options:WebAPI.EventAPI.addEventListenerOptions=?,)=>unitParameters
WebAPI.DOMAPI.documentWebAPI.EventAPI.eventTypeWebAPI.EventAPI.eventListener option<WebAPI.EventAPI.addEventListenerOptions >Return type
unitaddEventListenerWithCapture
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.Read more on MDN
letaddEventListenerWithCapture: (WebAPI.DOMAPI.document,WebAPI.EventAPI.eventType,WebAPI.EventAPI.eventListener<'event>,)=>unitParameters
WebAPI.DOMAPI.documentWebAPI.EventAPI.eventTypeWebAPI.EventAPI.eventListenerReturn type
unitadoptNode
Moves node from another document and returns it.
If node is a document, throws a "NotSupportedError" DOMException or, if node is a shadow root, throws a "HierarchyRequestError" DOMException.Read more on MDN
letadoptNode: (WebAPI.DOMAPI.document,'t)=>'tappend
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.Read more on MDN
letappend: (WebAPI.DOMAPI.document,WebAPI.DOMAPI.node)=>unitappend2
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.Read more on MDN
letappend2: (WebAPI.DOMAPI.document,string)=>unitasEventTarget
letasEventTarget:WebAPI.DOMAPI.document=>WebAPI.EventAPI.eventTargetasNode
letasNode:WebAPI.DOMAPI.document=>WebAPI.DOMAPI.nodecaretPositionFromPoint
letcaretPositionFromPoint: (WebAPI.DOMAPI.document,~x:float,~y:float,~options:WebAPI.DOMAPI.caretPositionFromPointOptions=?,)=>WebAPI.DOMAPI.caretPositionParameters
WebAPI.DOMAPI.document float float option<WebAPI.DOMAPI.caretPositionFromPointOptions >Return type
WebAPI.DOMAPI.caretPositioncloneNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants.Read more on MDN
letcloneNode: (WebAPI.DOMAPI.document,~deep:bool=?,)=>WebAPI.DOMAPI.documentclose
Closes an output stream and forces the sent data to display.Read more on MDN
letclose:WebAPI.DOMAPI.document=>unitcompareDocumentPosition
Returns a bitmask indicating the position of other relative to node.Read more on MDN
letcompareDocumentPosition: (WebAPI.DOMAPI.document,WebAPI.DOMAPI.node)=>intcontains
Returns true if other is an inclusive descendant of node, and false otherwise.Read more on MDN
letcontains: (WebAPI.DOMAPI.document,WebAPI.DOMAPI.node)=>boolcreateAttribute
Creates an attribute object with a specified name.@param name String that sets the attribute object's name.Read more on MDN
letcreateAttribute: (WebAPI.DOMAPI.document,string)=>WebAPI.DOMAPI.attrcreateAttributeNS
letcreateAttributeNS: (WebAPI.DOMAPI.document,~namespace:string,~qualifiedName:string,)=>WebAPI.DOMAPI.attrcreateCDATASection
Returns a CDATASection node whose data is data.Read more on MDN
letcreateCDATASection: (WebAPI.DOMAPI.document,string,)=>WebAPI.DOMAPI.cdataSectioncreateComment
Creates a comment object with the specified data.@param data Sets the comment object's data.Read more on MDN
letcreateComment: (WebAPI.DOMAPI.document,string)=>WebAPI.DOMAPI.commentcreateDocumentFragment
Creates a new document.Read more on MDN
letcreateDocumentFragment:WebAPI.DOMAPI.document=>WebAPI.DOMAPI.documentFragmentcreateElement
Creates an instance of the element for the specified tag.@param tagName The name of an element.Read more on MDN
letcreateElement: (WebAPI.DOMAPI.document,string,~options:string=?,)=>WebAPI.DOMAPI.elementcreateElement2
Creates an instance of the element for the specified tag.@param tagName The name of an element.Read more on MDN
letcreateElement2: (WebAPI.DOMAPI.document,~localName:string,~options:WebAPI.DOMAPI.elementCreationOptions=?,)=>WebAPI.DOMAPI.elementParameters
WebAPI.DOMAPI.document string option<WebAPI.DOMAPI.elementCreationOptions >Return type
WebAPI.DOMAPI.elementcreateElementNS
Returns 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.Read more on MDN
letcreateElementNS: (WebAPI.DOMAPI.document,~namespace:string,~qualifiedName:string,~options:string=?,)=>WebAPI.DOMAPI.elementcreateElementNS2
Returns 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.Read more on MDN
letcreateElementNS2: (WebAPI.DOMAPI.document,~namespace:string,~qualifiedName:string,~options:WebAPI.DOMAPI.elementCreationOptions=?,)=>WebAPI.DOMAPI.elementParameters
WebAPI.DOMAPI.document string string option<WebAPI.DOMAPI.elementCreationOptions >Return type
WebAPI.DOMAPI.elementcreateEvent
letcreateEvent: (WebAPI.DOMAPI.document,string)=>WebAPI.EventAPI.eventcreateExpression
letcreateExpression: (WebAPI.DOMAPI.document,~expression:string,~resolver:WebAPI.DOMAPI.xPathNSResolver=?,)=>WebAPI.DOMAPI.xPathExpressionParameters
WebAPI.DOMAPI.document string option<WebAPI.DOMAPI.xPathNSResolver >Return type
WebAPI.DOMAPI.xPathExpressioncreateNodeIterator
Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.@param root The root element or node to start traversing on.@param whatToShow The type of nodes or elements to appear in the node list@param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter.Read more on MDN
letcreateNodeIterator: (WebAPI.DOMAPI.document,~root:WebAPI.DOMAPI.node,~whatToShow:int=?,~filter:WebAPI.DOMAPI.nodeFilter=?,)=>WebAPI.DOMAPI.nodeIteratorParameters
WebAPI.DOMAPI.documentWebAPI.DOMAPI.node option< int > option<WebAPI.DOMAPI.nodeFilter >Return type
WebAPI.DOMAPI.nodeIteratorcreateProcessingInstruction
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.Read more on MDN
letcreateProcessingInstruction: (WebAPI.DOMAPI.document,~target:string,~data:string,)=>WebAPI.DOMAPI.processingInstructioncreateRange
Returns an empty range object that has both of its boundary points positioned at the beginning of the document.Read more on MDN
letcreateRange:WebAPI.DOMAPI.document=>WebAPI.DOMAPI.rangecreateTextNode
Creates a text string from the specified value.@param data String that specifies the nodeValue property of the text node.Read more on MDN
letcreateTextNode: (WebAPI.DOMAPI.document,string)=>WebAPI.DOMAPI.textcreateTreeWalker
Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.@param root The root element or node to start traversing on.@param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow.@param filter A custom NodeFilter function to use.Read more on MDN
letcreateTreeWalker: (WebAPI.DOMAPI.document,~root:WebAPI.DOMAPI.node,~whatToShow:int=?,~filter:WebAPI.DOMAPI.nodeFilter=?,)=>WebAPI.DOMAPI.treeWalkerParameters
WebAPI.DOMAPI.documentWebAPI.DOMAPI.node option< int > option<WebAPI.DOMAPI.nodeFilter >Return type
WebAPI.DOMAPI.treeWalkerdispatchEvent
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.Read more on MDN
letdispatchEvent: (WebAPI.DOMAPI.document,WebAPI.EventAPI.event)=>boolevaluate
letevaluate: (WebAPI.DOMAPI.document,~expression:string,~contextNode:WebAPI.DOMAPI.node,~resolver:WebAPI.DOMAPI.xPathNSResolver=?,~type_:int=?,~result:WebAPI.DOMAPI.xPathResult=?,)=>WebAPI.DOMAPI.xPathResultParameters
WebAPI.DOMAPI.document stringWebAPI.DOMAPI.node option<WebAPI.DOMAPI.xPathNSResolver > option< int > option<WebAPI.DOMAPI.xPathResult >Return type
WebAPI.DOMAPI.xPathResultexitFullscreen
Stops document's fullscreen element from being displayed fullscreen and resolves promise when done.Read more on MDN
letexitFullscreen:WebAPI.DOMAPI.document=>promise<unit>exitPictureInPicture
letexitPictureInPicture:WebAPI.DOMAPI.document=>promise<unit>exitPointerLock
letexitPointerLock:WebAPI.DOMAPI.document=>unitgetAnimations
letgetAnimations:WebAPI.DOMAPI.document=>array<WebAPI.DOMAPI.animation>getElementById
Returns the first element within node's descendants whose ID is elementId.Read more on MDN
letgetElementById: (WebAPI.DOMAPI.document,string)=>WebAPI.DOMAPI.elementgetElementsByClassName
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.Read more on MDN
letgetElementsByClassName: (WebAPI.DOMAPI.document,string,)=>WebAPI.DOMAPI.htmlCollectionOf<WebAPI.DOMAPI.element>Parameters
WebAPI.DOMAPI.document stringReturn type
WebAPI.DOMAPI.htmlCollectionOf<WebAPI.DOMAPI.element >getElementsByName
Gets a collection of objects based on the value of the NAME or ID attribute.@param elementName Gets a collection of objects based on the value of the NAME or ID attribute.Read more on MDN
letgetElementsByName: (WebAPI.DOMAPI.document,string,)=>WebAPI.DOMAPI.nodeListOf<WebAPI.DOMAPI.htmlElement>Parameters
WebAPI.DOMAPI.document stringReturn type
WebAPI.DOMAPI.nodeListOf<WebAPI.DOMAPI.htmlElement >getElementsByTagName
Retrieves a collection of objects based on the specified element name.@param name Specifies the name of an element.Read more on MDN
letgetElementsByTagName: (WebAPI.DOMAPI.document,string,)=>WebAPI.DOMAPI.htmlCollectiongetElementsByTagNameNS
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.Read more on MDN
letgetElementsByTagNameNS: (WebAPI.DOMAPI.document,~namespace:string,~localName:string,)=>WebAPI.DOMAPI.htmlCollectionOf<WebAPI.DOMAPI.element>Parameters
WebAPI.DOMAPI.document string stringReturn type
WebAPI.DOMAPI.htmlCollectionOf<WebAPI.DOMAPI.element >getRootNode
Returns node's root.Read more on MDN
letgetRootNode: (WebAPI.DOMAPI.document,~options:WebAPI.DOMAPI.getRootNodeOptions=?,)=>WebAPI.DOMAPI.nodeParameters
WebAPI.DOMAPI.document option<WebAPI.DOMAPI.getRootNodeOptions >Return type
WebAPI.DOMAPI.nodegetSelection
Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.Read more on MDN
letgetSelection:WebAPI.DOMAPI.document=>WebAPI.DOMAPI.selectionhasChildNodes
Returns whether node has children.Read more on MDN
lethasChildNodes:WebAPI.DOMAPI.document=>boolhasFocus
Gets a value indicating whether the object currently has focus.Read more on MDN
lethasFocus:WebAPI.DOMAPI.document=>boolhasStorageAccess
lethasStorageAccess:WebAPI.DOMAPI.document=>promise<bool>importNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants.
If node is a document or a shadow root, throws a "NotSupportedError" DOMException.Read more on MDN
letimportNode: (WebAPI.DOMAPI.document,'t, ~deep:bool=?)=>'tinsertBefore
letinsertBefore: (WebAPI.DOMAPI.document,'t,~child:WebAPI.DOMAPI.node,)=>'tisDefaultNamespace
letisDefaultNamespace: (WebAPI.DOMAPI.document,string)=>boolisEqualNode
Returns whether node and otherNode have the same properties.Read more on MDN
letisEqualNode: (WebAPI.DOMAPI.document,WebAPI.DOMAPI.node)=>boolisInstanceOf
letisInstanceOf:'t=>boolisSameNode
letisSameNode: (WebAPI.DOMAPI.document,WebAPI.DOMAPI.node)=>boollookupNamespaceURI
letlookupNamespaceURI: (WebAPI.DOMAPI.document,string)=>stringlookupPrefix
letlookupPrefix: (WebAPI.DOMAPI.document,string)=>stringmake
letmake:unit=>WebAPI.DOMAPI.documentnormalize
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.Read more on MDN
letnormalize:WebAPI.DOMAPI.document=>unitopen_
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.@param url Specifies a MIME type for the document.@param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.@param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported.@param replace Specifies whether the existing entry for the document is replaced in the history list.Read more on MDN
letopen_: (WebAPI.DOMAPI.document,~unused1:string=?,~unused2:string=?,)=>WebAPI.DOMAPI.documentopen2
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.@param url Specifies a MIME type for the document.@param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.@param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported.@param replace Specifies whether the existing entry for the document is replaced in the history list.Read more on MDN
letopen2: (WebAPI.DOMAPI.document,~url:string,~name:string,~features:string,)=>WebAPI.DOMAPI.windowparseHTMLUnsafe
letparseHTMLUnsafe:string=>WebAPI.DOMAPI.documentprepend
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.Read more on MDN
letprepend: (WebAPI.DOMAPI.document,WebAPI.DOMAPI.node)=>unitprepend2
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.Read more on MDN
letprepend2: (WebAPI.DOMAPI.document,string)=>unitquerySelector
Returns the first element that is a descendant of node that matches selectors.Read more on MDN
letquerySelector: (WebAPI.DOMAPI.document,string,)=>Null.t<WebAPI.DOMAPI.element>querySelectorAll
Returns all element descendants of node that match selectors.Read more on MDN
letquerySelectorAll: (WebAPI.DOMAPI.document,string)=>WebAPI.DOMAPI.nodeListremoveEventListener
Removes the event listener in target's event listener list with the same type, callback, and options.Read more on MDN
letremoveEventListener: (WebAPI.DOMAPI.document,WebAPI.EventAPI.eventType,WebAPI.EventAPI.eventListener<'event>,~options:WebAPI.EventAPI.eventListenerOptions=?,)=>unitParameters
WebAPI.DOMAPI.documentWebAPI.EventAPI.eventTypeWebAPI.EventAPI.eventListener option<WebAPI.EventAPI.eventListenerOptions >Return type
unitremoveEventListener_useCapture
Removes the event listener in target's event listener list with the same type, callback, and options.Read more on MDN
letremoveEventListener_useCapture: (WebAPI.DOMAPI.document,WebAPI.EventAPI.eventType,WebAPI.EventAPI.eventListener<'event>,)=>unitParameters
WebAPI.DOMAPI.documentWebAPI.EventAPI.eventTypeWebAPI.EventAPI.eventListenerReturn type
unitreplaceChild
letreplaceChild: (WebAPI.DOMAPI.document,~node:WebAPI.DOMAPI.node,'t,)=>'treplaceChildren
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.Read more on MDN
letreplaceChildren: (WebAPI.DOMAPI.document,WebAPI.DOMAPI.node)=>unitreplaceChildren2
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.Read more on MDN
letreplaceChildren2: (WebAPI.DOMAPI.document,string)=>unitrequestStorageAccess
letrequestStorageAccess:WebAPI.DOMAPI.document=>promise<unit>startViewTransition
letstartViewTransition: (WebAPI.DOMAPI.document,~callbackOptions:WebAPI.ViewTransitionsAPI.viewTransitionUpdateCallback=?,)=>WebAPI.ViewTransitionsAPI.viewTransitionParameters
WebAPI.DOMAPI.document option<WebAPI.ViewTransitionsAPI.viewTransitionUpdateCallback >Return type
WebAPI.ViewTransitionsAPI.viewTransitionwrite
Writes one or more HTML expressions to a document in the specified window.@param content Specifies the text and HTML tags to write.Read more on MDN
letwrite: (WebAPI.DOMAPI.document,string)=>unitwriteln
Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.@param content The text and HTML tags to write.Read more on MDN
letwriteln: (WebAPI.DOMAPI.document,string)=>unit