1,childnodes
The ChildNodes property returns an array that contains the entire child elements of the given element node.
Retrieves the first child node of a BODY element:
var body_element=document.getelementbytagname ("Body") [0];
The BODY element has several child elements
var body_element_length=body_element.lchildnodes.length;
2,notetype
Retrieving the type of a node
alert (Body_element.notetype);
There are 12 types of notetype, but only three are of practical value: element node (attribute value 1), Attribute node (property value 2), text node (property value 3)
3,nodevalue
If you want to change the value of a text node, use the NodeValue property to retrieve and set the value of the node: Node.nodevalue
For example, retrieving <p id= "description" > the text value inside the,<p> element of the NodeValue attribute is a null value, the text contained in the <p> element is another node, is the first child node of the <p> element
alert (Description.childnodes[0].nodevalue);
4,firstchild
Represents the first element of a childnodes[] array, childnodes[0] is equivalent to FirstChild
5,lastchild
Represents the last element of the childnodes[] array, lastchild equivalent to childnodes[node.childnodes.length-1]
Related properties of node in JavaScript