Node in Java script

Source: Internet
Author: User

The NodeType attribute has a total of 12 desirable values, of which only 3 are of practical value.

The value of the NodeType property of the element node is 1.

of the attr attribute node NodeType Property value is 2 .

of the text literal node. NodeType Property value is 3.

Use the NodeType property to manipulate the specified node type.

Element inherited the Node class, which means Element is a Node one of several types , that is, when NodeType is 1 o'clock node is elementnode, the other element extends the node,element has the ID, class, children and other attributes.

Children is a Element the properties, ChildNodes is a Node of the Properties

Element Children[0] is still element, which is an instance of node and element, node Childndoes[0] is node, just an instance of node, not an instance of element.

At the same time,Node 's children Property is undefined.

ParentNode is a property of the node class. Returns the specified parent node

Returns null if the specified node does not have a parent node

ChildNodes is also a property of the node class. Returns a collection of child nodes of a node, nodelist as an object

Node in Java script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.