The Document Interface
The document interface returns information about the document itself. Of these, the one that will be used most often is the documentElement attribute that creates a node of the root element of the document. If you are walking the document tree to find an element, this is a great way to start. The document interface has the following read-only attributes:
doctype
implementation
documentElement
The first eight methods of the document interface listed below are mainly concerned with creating different kinds of nodes. (As you will learn, the ninth, getElementsByTagName(), is of special importance.)
The interface has the following methods:
createElement()
createDocumentFragment()
createTextNode()
createComment() ...
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