Document
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
§Properties
Returns a reference to the collection of elements contained by the object.
Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.
Retrieves a collection of all applet objects in the document.
Deprecated. Sets or retrieves a value that indicates the background color behind the object.
Specifies the beginning and end of the document body.
Gets a value that indicates whether standards-compliant mode is switched on for the object.
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.
Returns 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.
Returns the Window object of the active document.
Gets an object representing the document type declaration associated with the current document.
Gets a reference to the root node of the document.
Retrieves a collection of all embed objects in the document.
Retrieves a collection, in source order, of all form objects in the document.
Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.
Returns the head element.
Retrieves a collection, in source order, of img objects in the document.
Gets the implementation object of the current document.
Returns the character encoding used to create the webpage that is loaded into the document object.
Gets the date that the page was last modified, if the page supplies one.
Retrieves a collection of all a objects that specify the href property and all area objects in the document.
Return an HTMLCollection of the embed elements in the Document.
Retrieves a value that indicates the current state of the object.
Gets the URL of the location that referred the user to the current page.
Retrieves a collection of all script objects in the document.
§Methods
Returns a CDATASection node whose data is data.
Creates a new document.
Creates an instance of the element for the specified tag.
The name of an element.
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.
Creates 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.
The type of nodes or elements to appear in the node list
A 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.
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.
The type of nodes or elements to appear in the node list. For more information, see whatToShow.
A custom NodeFilter function to use.
Executes 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.
Display the user interface, defaults to false.
Value 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.
Specifies the name of an element.
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.
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.
Specifies a MIME type for the document.
Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.
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.
Specifies whether the existing entry for the document is replaced in the history list.
Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.
Specifies a command identifier.
Returns a Boolean value that indicates whether the specified command is in the indeterminate state.
String that specifies a command identifier.
Returns a Boolean value that indicates the current state of the command.
String that specifies a command identifier.
Returns a Boolean value that indicates whether the current command is supported on the current range.
Specifies a command identifier.
Returns the current value of the document, range, or current selection for the given command.
String that specifies a command identifier.