One, the JavaScript node is dynamic to get the name of the element, in order to do the element operation, in node has two methods to use, the first method is NodeType, the second method is nodename, both methods can be used to manipulate elements.
1. NodeType syntax------It is to manipulate elements by judging the type of the element, for example, the div element is an element, that is, it is possible to judge the elements, and if the elements are element, the return result is true, or it can be manipulated at this point.
2, nodename syntax-----It is through the name of the element to determine the operation of the element, such as a div its ID name is called one, then when the judgment is written nodename== "one", and then by the method of obtaining a variable to manipulate the element. Note: The name of the element must be the ID name can be and the name of the element to be capitalized, in time to write the use of lowercase, but the judgment must be capitalized, otherwise it will not perform the effect.
3. The top-level Document object syntax for obtaining the current document is owndocument.
4. The latter document object that is used to obtain the current document sibling.
5. The previous document object that is used to obtain the current object's sibling.
The JavaScript node