What is DOM, not javascript? DOM is a document. DOM is a set of web standards used to describe how scripts interact and access structured documents. DOM defines a series of objects, methods, and attributes for accessing, manipulating, and creating content, structures, styles, and actions in a document. The role of inheritance in DOM when the browser parses a document file, each node is not a simple Element object instance, but inherits the extension of Element objects of many things.
The nodeName value nodeValue attribute corresponding to each Node type of the core object Node in the core Node object Node name, type, and value DOM2 is only applicable to a few DOM objects, in particular, Attr, ProcessingInstructions, Comments, Text, and CDATASection. In addition, the nodeValue attribute of all other objects returns null. The expected nodeValue for each nodeType specified in the DOM2 Core Specification: nodeType: The nodeType we saw earlier. It contains an integer value corresponding to a named constant in the following table. The constants listed in the table represent the core DOM objects. Therefore, you can determine the types of DOM core objects derived from a node. The nodeType constant of the DOM core object: Node nodes reference each other and attribute Node attributes: alert (baidu. attributes. getNamedItem ('href '). nodeValue); (to obtain a single attribute of a node) The following is the test code: [html] <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">