SUMMARY
The Document Object Model (DOM) is a language-independent API for accessing and manipulating HTML and XML documents. DOM Level 1 deals with representing HTML and XML documents as a hierarchy of nodes that can be manipulated to change the appearance and structure of the underlying documents using JavaScript.
The DOM is made up of a series of node types, as described here:
- The base node type is
Node
, which is an abstract representation of an individual part of a document; all other types inherit fromNode
. - The
Document
type represents an entire document and is the root node of a hierarchy. In JavaScript, thedocument
object is an instance ofDocument
, which allows for querying and retrieval of nodes in a number of different ways. - An
Element
node represents all HTML or XML elements in a document and can be used to manipulate their contents and attributes. - Other node types exist for text contents, comments, document types, the CDATA section, and document fragments.
DOM access works...