1. How to get nodes:
1) Get the node through the top layer:
document.getElementById (""); Gets the attribute value of the node by ID. Note: If you have more than one node with the same ID, only the first node is returned
Document.getelementsbyname (""); Returns an array of the same name element. Then, by judging the property to determine whether the node is required, take radio,checkbox as an example, by judging whether the check property is true;
document.getElementsByTagName (); Gets data by tag name, returns a set of nodes of the same label;
2) Get through parent node:
Obj.firstchild; The first child node of a known node, and the ability to recursively use obj.firstchild.firstchild.firstchild ....
Obj.lastchild; The last node of the known node; Obj.lastChild.lastChild.lastChild can be recursively used ....
The above two ways can alternately use obj.firstChild.lastChild.firstChild ...
Obj.childnodes: Gets the array of child nodes for the known node. Gets the desired node by looping through the index.
Parentobj.children: Gets an array of direct child nodes for a known node.
Parentobj.getelementsbytagname (): Gets an array of all child nodes of the specified type for the known node;
3) query by neighboring nodes:
Neighbournode.previoussibling: Gets the previous node of a known node; it can be used iteratively and can be used in combination with Firstchild,lastchild.
neighbournode.nextsilbling: Gets the next one of the known nodes nodes, can be used iteratively, or mixed with firstchild,lastchild.
3) Get through child nodes:
Childnode.parentnode; Gets the parent node through a known node.
Note: The document method gets: from the global find; The Document object is part of the Window object;
JSP gets the text value and parameter attribute value of the DOM node and the node