Name
Document — Inherits Node
Synopsis
The Document
interface is the object representation of an entire XML document. It
contains all of the root elements, as well as the document type. The
contained child objects of the Document have their ownerDocument attribute associated with
this parent.
doctypeContains the Document Type Declaration associated with the document. The value is read-only, and cannot be modified in DOM Level 2.
documentElementRepresents the root element of the document. As you work with the DOM, dealing with elements is a natural thing, and being able to quickly extract the root element of any document object is desirable.
implementationThe
DOMImplementationobject that handles this document.createAttribute(name)Creates an
Attrobject with thenamesupplied. Support for namespaces is provided with thecreateAttributeNSmethod.createAttributeNS(namespaceURI, qualifiedName)Does essentially the same task as
createAttribute(name), however it creates the attribute with the givennamespaceURI.createCDATASection(data)Creates and returns a
CDATAnode section with the supplied data.createComment(data)Creates and returns a comment node.
createDocumentFragment( )Creates and returns an empty
DocumentFragmentobject.createElement(tagname)Creates an element with the given element
tagname. Returns anElementobject.createElementNS(namespaceURI, qualifiedName)Same as
createElement; however thenamespaceURIis associated with the element.createEntityReference( ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access