Attributes:
1Attributes stores the node's attribute list (read-only)
2childNodes stores the node's child node list (read-only)
3dataType returns the data type of this node
4Definition in DTD or XML The definition of the node given by the mode (read-only)
5Doctype specifies the document type node (read-only)
6documentElement returns the root element of the document (readable and writable)
7firstChild returns the first child node of the current node (read-only)
8Implementation returns an XMLDOMImplementation object
9lastChild returns the last child node of the current node (read-only)
10nextSibling returns the next sibling node of the current node (read-only)
11nodeName returns the name of the node (read-only)
12nodeType returns the type of node (read-only)
13nodeTypedValue stores the node value (readable and writable)
14nodeValue returns the text of the node (readable and writable)
15ownerDocument returns the document containing this node Root document (read-only)
16parentNode Returns the parent node (read-only)
17Parsed Returns whether this node and its child nodes have been parsed (read-only)
18Prefix Returns the namespace prefix (read-only)
19preserveWhiteSpace Specifies whether to preserve white space (readable and writable)
20previousSibling Returns the previous sibling node of this node (read-only)
21Text Returns the text content of this node and its descendants (readable and writable)
22url Return The URL of the recently loaded XML document (read-only)
23Xml Returns the XML representation of the node and its descendants (read-only)
Method:
1appendChild Adds a new child node to the current node, placed at the end After the child node
2cloneNode returns a copy of the current node
3createAttribute creates a new attribute
4createCDATASection creates a CDATA segment including the given data
5createComment creates a comment node
6createDocumentFragment creates a DocumentFragment object
7createElement creates an element node
8createEntityReference creates an EntityReference object
9createNode creates a node of the given type, name and namespace
10createPorcessingInstruction creates an operation instruction node
11createTextNode creates a text node including the given data
12getElementsByTagName Returns a collection of elements with the specified name
13hasChildNodes Returns whether the current node has child nodes
14insertBefore Inserts a child node before the specified node
15Load Imports the XML document at the specified location
16loadXML Imports the XML of the specified string Document
17removeChild Delete the specified child node from the child node list
18replaceChild Replace the specified child node from the child node list
19Save Save the XML file to the specified node
20selectNodes Specify the node Match, and return a list of matching nodes
21selectSingleNode performs a specified match on the node, and returns the first matching node
22transformNode uses the specified style sheet to transform the node and its descendants
23transformNodeToObject uses the specified style sheet Convert node and its descendants to objects
************************************
DOM (documentation Object Model)
With the introduction of the concept of DOM (Document Object Model), this API has made HTML even more powerful, but some friends who are learning DHTML are still a little confused, just because the current manual is not very scientifically written, and it is written in letters
It’s divided, so it’s inconvenient to look up. In fact, the most important thing in DOM is to master the relationship between nodes (between node and node). If you want to learn the DOM in DHTML, don’t read all the attributes from beginning to end. And methods, do you have the "photographic memory" ability of Zhang Song during the Three Kingdoms? No, then let me analyze it:
In fact, what DOM teaches us is a hierarchical structure, which you can understand as a tree shape The structure, just like our directory, is a root directory. There are subdirectories under the root directory, and there are subdirectories under the subdirectories...
Root node:
DOM puts every object in the hierarchy It is called a node (NODE), taking HTML Hypertext Markup Language as an example: a root of the entire document is , which can be accessed in the DOM using
document.documentElement, which is the root of the entire node tree. Node (ROOT)
Child node:
A node in the general sense. The largest child node below the root node is the main document area