Document

Example

1

Description

Properties

Property Name Description
anchors array of all the anchors in the document
cookie
documentElement the root node of the document
documentMode returns the mode used by the browser to render the document
domain the domain name of the server that loaded the document
forms array of all the forms in the document
images array of all the images in the document
implementation the DOMImplementation object for the document
lastModified date and time the document was last modified
links array of all the links in the document
readyState the loading/ready status of the document
referrer URL of the document that loaded the current document
title title of the document
URL full URL of this document

Methods

Method Name Description Values
createAttribute() Returns a new attribute node with the given name.
createAttributeNS() Returns a new attribute node with the given name in the given namespace.
createCDATASection() Returns a new CDATASection object.
createComment() Returns a new Comment object containing the supplied text.
createDocumentFragment() Returns a new DocumentFragment object.
createElement() Returns a new Element object for the given element name.
createElementNS() Returns a new Element object for the given element name in the specified namespace.
createEntityReference() Returns a new EntityReference object with the given name.
createProcessingInstruction() Returns a new ProcessingInstruction object with the specified target name and data string.
createTextNode() Returns a new Text object with the specified string.
getElementById() Returns the first element with the given ID.
getElementsByName() Returns a NodeList of Elements with the specified name.
getElementsByTagName() Returns a NodeList of Elements with the specified tag name. "*" returns all descendants.
getElementsByTagNameNS() Returns a NodeList of Elements with the specified tag name in the specified namespace. "*" returns all descendants.
importNode() Returns a copy of a node from an external document that can be inserted into the current document. If deep = true, all of the node's children will also be copied.
open() Returns a new Document for writing.
write() Appends the HTML string to the document.
writeln() Appends the HTML string, followed by a newline character, to the document.