Interface

Document

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.

View Source js/lib.dom.d.ts, line 1199

Members

T

# adoptNode

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.

View Source js/lib.dom.d.ts, line 1403

string

# alinkColor

Sets or gets the color of all active links in the document.

View Source js/lib.dom.d.ts, line 1207

HTMLAllCollection

# all

Returns a reference to the collection of elements contained by the object.

View Source js/lib.dom.d.ts, line 1212

HTMLCollectionOf.<HTMLAnchorElement>

# anchors

Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.

View Source js/lib.dom.d.ts, line 1217

HTMLCollectionOf.<HTMLAppletElement>

# applets

Retrieves a collection of all applet objects in the document.

View Source js/lib.dom.d.ts, line 1222

string

# bgColor

Deprecated. Sets or retrieves a value that indicates the background color behind the object.

View Source js/lib.dom.d.ts, line 1227

HTMLElement

# body

Specifies the beginning and end of the document body.

View Source js/lib.dom.d.ts, line 1232

void

# captureEvents

Deprecated:
  • Yes

View Source js/lib.dom.d.ts, line 1410

Range

# caretRangeFromPoint

Deprecated:
  • Yes

View Source js/lib.dom.d.ts, line 1414

string

# characterSet

Returns document's encoding.

View Source js/lib.dom.d.ts, line 1237

string

# charset

Gets or sets the character set used to encode the object.

View Source js/lib.dom.d.ts, line 1242

void

# clear

Deprecated:
  • Yes

View Source js/lib.dom.d.ts, line 1418

void

# close

Closes an output stream and forces the sent data to display.

View Source js/lib.dom.d.ts, line 1422

string

# compatMode

Gets a value that indicates whether standards-compliant mode is switched on for the object.

View Source js/lib.dom.d.ts, line 1247

string

# contentType

Returns document's content type.

View Source js/lib.dom.d.ts, line 1252

string

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.

View Source js/lib.dom.d.ts, line 1257

Attr

# createAttribute

Creates an attribute object with a specified name.

View Source js/lib.dom.d.ts, line 1427

CDATASection

# createCDATASection

Returns a CDATASection node whose data is data.

View Source js/lib.dom.d.ts, line 1433

Comment

# createComment

Creates a comment object with the specified data.

View Source js/lib.dom.d.ts, line 1438

DocumentFragment

# createDocumentFragment

Creates a new document.

View Source js/lib.dom.d.ts, line 1444

# createElement

Creates an instance of the element for the specified tag.

View Source js/lib.dom.d.ts, line 1449

# createElement

Deprecated:
  • Yes

View Source js/lib.dom.d.ts, line 1455

HTMLElement

# createElementNS

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.

View Source js/lib.dom.d.ts, line 1459

NodeIterator

# createNodeIterator

Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.

View Source js/lib.dom.d.ts, line 1476

ProcessingInstruction

# createProcessingInstruction

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.

View Source js/lib.dom.d.ts, line 1485

Range

# createRange

Returns an empty range object that has both of its boundary points positioned at the beginning of the document.

View Source js/lib.dom.d.ts, line 1490

Text

# createTextNode

Creates a text string from the specified value.

View Source js/lib.dom.d.ts, line 1495

TreeWalker

# createTreeWalker

Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.

View Source js/lib.dom.d.ts, line 1501

TreeWalker

# createTreeWalker

Deprecated:
  • Yes

View Source js/lib.dom.d.ts, line 1510

HTMLOrSVGScriptElement | null

# currentScript

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.

View Source js/lib.dom.d.ts, line 1266

string

# designMode

Sets or gets a value that indicates whether the document can be edited.

View Source js/lib.dom.d.ts, line 1273

string

# dir

Sets or retrieves a value that indicates the reading order of the object.

View Source js/lib.dom.d.ts, line 1278

DocumentType | null

# doctype

Gets an object representing the document type declaration associated with the current document.

View Source js/lib.dom.d.ts, line 1283

HTMLElement

# documentElement

Gets a reference to the root node of the document.

View Source js/lib.dom.d.ts, line 1288

string

# documentURI

Returns document's URL.

View Source js/lib.dom.d.ts, line 1293

string

# domain

Sets or gets the security domain of the document.

View Source js/lib.dom.d.ts, line 1298

Element | null

# elementFromPoint

Returns the element for the specified x coordinate and the specified y coordinate.

View Source js/lib.dom.d.ts, line 1514

HTMLCollectionOf.<HTMLEmbedElement>

# embeds

Retrieves a collection of all embed objects in the document.

View Source js/lib.dom.d.ts, line 1303

boolean

# execCommand

Executes a command on the current document, current selection, or the given range.

View Source js/lib.dom.d.ts, line 1521

Promise.<void>

# exitFullscreen

Stops document's fullscreen element from being displayed fullscreen and resolves promise when done.

View Source js/lib.dom.d.ts, line 1529

string

# fgColor

Sets or gets the foreground (text) color of the document.

View Source js/lib.dom.d.ts, line 1308

HTMLCollectionOf.<HTMLFormElement>

# forms

Retrieves a collection, in source order, of all form objects in the document.

View Source js/lib.dom.d.ts, line 1313

boolean

# fullscreen

Deprecated:
  • Yes

View Source js/lib.dom.d.ts, line 1318

boolean

# fullscreenEnabled

Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.

View Source js/lib.dom.d.ts, line 1322

HTMLElement | null

# getElementById

Returns a reference to the first object with the specified value of the ID attribute.

View Source js/lib.dom.d.ts, line 1534

HTMLCollectionOf.<Element>

# getElementsByClassName

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.

View Source js/lib.dom.d.ts, line 1540

NodeListOf.<HTMLElement>

# getElementsByName

Gets a collection of objects based on the value of the NAME or ID attribute.

View Source js/lib.dom.d.ts, line 1545

# getElementsByTagName

Retrieves a collection of objects based on the specified element name.

View Source js/lib.dom.d.ts, line 1551

HTMLCollectionOf.<HTMLElement>

# getElementsByTagNameNS

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.

View Source js/lib.dom.d.ts, line 1557

Selection | null

# getSelection

Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.

View Source js/lib.dom.d.ts, line 1568

boolean

# hasFocus

Gets a value indicating whether the object currently has focus.

View Source js/lib.dom.d.ts, line 1573

HTMLHeadElement

Returns the head element.

View Source js/lib.dom.d.ts, line 1327

HTMLCollectionOf.<HTMLImageElement>

# images

Retrieves a collection, in source order, of img objects in the document.

View Source js/lib.dom.d.ts, line 1332

DOMImplementation

# implementation

Gets the implementation object of the current document.

View Source js/lib.dom.d.ts, line 1337

T

# 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.

View Source js/lib.dom.d.ts, line 1578

string

# inputEncoding

Returns the character encoding used to create the webpage that is loaded into the document object.

View Source js/lib.dom.d.ts, line 1342

string

# lastModified

Gets the date that the page was last modified, if the page supplies one.

View Source js/lib.dom.d.ts, line 1347

string

# linkColor

Sets or gets the color of the document links.

View Source js/lib.dom.d.ts, line 1352

HTMLCollectionOf.<(HTMLAnchorElement|HTMLAreaElement)>

Retrieves a collection of all a objects that specify the href property and all area objects in the document.

View Source js/lib.dom.d.ts, line 1357

Location

# location

Contains information about the current URL.

View Source js/lib.dom.d.ts, line 1362

# onreadystatechange

Fires when the state of the object has changed.

View Source js/lib.dom.d.ts, line 1367

Document

# open

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.

View Source js/lib.dom.d.ts, line 1585

HTMLCollectionOf.<HTMLEmbedElement>

# plugins

Return an HTMLCollection of the embed elements in the Document.

View Source js/lib.dom.d.ts, line 1373

boolean

# queryCommandEnabled

Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.

View Source js/lib.dom.d.ts, line 1594

boolean

# queryCommandIndeterm

Returns a Boolean value that indicates whether the specified command is in the indeterminate state.

View Source js/lib.dom.d.ts, line 1600

boolean

# queryCommandState

Returns a Boolean value that indicates the current state of the command.

View Source js/lib.dom.d.ts, line 1606

boolean

# queryCommandSupported

Returns a Boolean value that indicates whether the current command is supported on the current range.

View Source js/lib.dom.d.ts, line 1612

string

# queryCommandValue

Returns the current value of the document, range, or current selection for the given command.

View Source js/lib.dom.d.ts, line 1618

DocumentReadyState

# readyState

Retrieves a value that indicates the current state of the object.

View Source js/lib.dom.d.ts, line 1378

string

# referrer

Gets the URL of the location that referred the user to the current page.

View Source js/lib.dom.d.ts, line 1383

void

# releaseEvents

Deprecated:
  • Yes

View Source js/lib.dom.d.ts, line 1624

HTMLCollectionOf.<HTMLScriptElement>

# scripts

Retrieves a collection of all script objects in the document.

View Source js/lib.dom.d.ts, line 1388

string

# title

Contains the title of the document.

View Source js/lib.dom.d.ts, line 1393

string

# URL

Sets or gets the URL for the current document.

View Source js/lib.dom.d.ts, line 1202

string

# vlinkColor

Sets or gets the color of the links that the user has visited.

View Source js/lib.dom.d.ts, line 1398

void

# write

Writes one or more HTML expressions to a document in the specified window.

View Source js/lib.dom.d.ts, line 1628

void

# writeln

Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.

View Source js/lib.dom.d.ts, line 1634