The Document object
The document object is the root element in the node tree. All
nodes in the node tree are childNodes of the document element.
The document element is required in all XML documents. Listed
below are the properties and methods made for the document
object.
Document Properties
Name Description
documentElement Returns the root element of the document
doctype Returns the DTD or Schema for the document.
implementation Returns the implementation object for this
particular document
Document Methods
Name Description
createAttribute(attributeName) Creates an attribute node with
the specified attribute name
createCDATASection(text) Creates a CDATASection, containing the
specified text
createComment(text) Creates a comment node, containing the
specified text
createDocumentFragment() Creates an empty documentFragment
object
createElement(tagName) Creates an element with the specified
tagName
createEntityReference(referenceName) Creates an entityReference
with the specified referenceName
createProcessingInstruction(target,text) Creates a
processingInstruction node, containing the specified target and
text
createTextNode(text) Creates a text node, containing the
specified text
getElementsByTagName(tagName) Returns the specified node, and
all its child nodes, as a nodeList