XMLDocument
The XMLDocument interface represents an XML document.
Properties
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.
The Document.body
property represents the null
if no such element exists.
node is a CDATASection node.
The Document.characterSet
read-only property returns the character encoding of the document that it's currently rendered with.
The read-only childNodes
property of the Node interface returns a live the first child node is assigned index 0
.
Returns the child elements.
node is a Comment node.
The Document.compatMode
read-only property indicates whether the document is rendered in Quirks mode or Standards mode.
The Document.contentType
read-only property returns the MIME type that the document is being rendered as.
The Document.currentScript
property returns the script element whose script is currently being processed and isn't a JavaScript module.
In browsers, document.defaultView
returns the This property is read-only.
document.designMode
controls whether the entire document is editable.
The doctype
read-only property of the Document interface is a DocumentType object representing the Doctype associated with the current document.
node is a DocumentFragment node.
node is a document.
Set when other is a descendant of node.
Set when other is an ancestor of node.
Set when node and other are not in the same tree.
Set when other is following node.
Set when other is preceding node.
node is a doctype.
The documentElement
read-only property of the Document interface returns the example, the html element for HTML documents).
The documentURI
read-only property of the A string.
node is an element.
The embeds
read-only property of the An HTMLCollection.
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.
Returns the first child that is an element, and null otherwise.
The forms
read-only property of the Document interface returns an HTMLCollection listing all the form elements contained in the document.
The fragmentDirective
read-only property of the Document interface returns the FragmentDirective for the current document.
Returns document's fullscreen element.
The read-only fullscreenEnabled
property on the Document interface indicates whether or not fullscreen mode is available.
The head
read-only property of the Document interface returns the head element of the current document.
The images
read-only property of the Document interface returns a collection of the images in the current HTML document.
The Document.implementation
property returns a A DOMImplementation object.
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.
Returns the last child that is an element, and null otherwise.
The lastModified
property of the Document interface returns a string containing the date and local time on which the current document was last modified.
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.
The read-only nextSibling
property of the Node interface returns the node immediately following the specified one in their parent's Node.childNodes, or returns null
if the specified node is the last child in the parent element.
Available only in secure contexts.
The read-only ownerDocument
property of the Node interface returns the top-level document object of the node.
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.
The read-only parentNode
property of the Node interface returns the parent of the specified node in the DOM tree.
The read-only pictureInPictureEnabled
property of the available.
The plugins
read-only property of the containing one or more HTMLEmbedElements representing the An HTMLCollection.
The read-only previousSibling
property of the Node interface returns the node immediately preceding the specified one in its parent's or null
if the specified node is the first in that list.
node is a ProcessingInstruction node.
The Document.readyState
property describes the loading state of the document.
The scripts
property of the Document interface returns a list of the script elements in the document.
The scrollingElement
read-only property of the scrolls the document.
The textContent
property of the Node interface represents the text content of the node and its descendants.
The timeline
readonly property of the Document interface represents the default timeline of the current document.
The Document.visibilityState
read-only property returns the visibility of the document.
Functions
The appendChild()
method of the Node interface adds a node to the end of the list of children of a specified parent node.
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.
The compareDocumentPosition()
method of the Node interface reports the position of its argument node relative to the node on which it is called.
The Document.createAttribute()
method creates a new attribute node, and returns it.
The Document.createAttributeNS()
method creates a new attribute node with the specified namespace URI and qualified name, and returns it.
createCDATASection()
creates a new CDATA section node, and returns it.
createComment()
creates a new comment node, and returns it.
Creates a new empty DocumentFragment into which DOM nodes can be added to build an offscreen DOM tree.
In an HTML document, the document.createElement()
method creates the HTML element specified by localName
, or an HTMLUnknownElement if localName
isn't recognized.
The Document.createNodeIterator()
method returns a new NodeIterator
object.
createProcessingInstruction()
generates a new processing instruction node and returns it.
The Document.createRange()
method returns a new ``js-nolint createRange() ``
None.
Creates a new Text node.
The Document.createTreeWalker()
creator method returns a newly created TreeWalker object.
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.
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.
The exitPointerLock()
method of the Document interface asynchronously releases a pointer lock previously requested through Element.requestPointerLock.
Returns the first element within node's descendants whose ID is elementId.
The getElementsByClassName
method of of all child elements which have all of the given class name(s).
The getElementsByName()
method of the Document object returns a NodeList Collection of elements with a given name
attribute in the document.
The getElementsByTagName
method of The complete document is searched, including the root node.
The getRootNode()
method of the Node interface returns the context object's root, which optionally includes the shadow root if it is available.
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.
The hasChildNodes()
method of the Node interface returns a boolean value indicating whether the given Node has child nodes or not.
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.
The Document object's importNode()
method creates a copy of a inserted into the current document later.
The isDefaultNamespace()
method of the Node interface accepts a namespace URI as an argument.
The isEqualNode()
method of the Node interface tests whether two nodes are equal.
The isSameNode()
method of the Node interface is a legacy alias the for the ===
strict equality operator.
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).
The lookupPrefix()
method of the Node interface returns a string containing the prefix for a given namespace URI, if present, and null
if not.
The Document.open()
method opens a document for This does come with some side effects.
Returns the first element that is a descendant of node that matches selectors.
Returns all element descendants of node that match selectors.
The removeChild()
method of the Node interface removes a child node from the DOM and returns the removed node.
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
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.
The startViewTransition()
method of the Document interface starts a new same-document (SPA) view transition and returns a ViewTransition object to represent it.