ParentNode parentelement childNodes Children

Source: Internet
Author: User

First of all to understand ParentNode ChildNodes is the standard.

It's all about adding a Chrome browser to the HTML (please forgive my slag ...)

For HTML documents, it can be understood that the node tree, the element tree, is made up of nodes in the tree, and in the element tree is HtmlElement

Node's include text (text node), Comment (note), htmldocument,htmlelment node, parentnode childnodes are all in the node tree, that is, they will include a textual node and a comment node, When the first of the text in the element in the sense is the carriage return, the ChildNodes returns an object with a nodevalue (the text and comment nodes have properties that return the value) as the carriage return symbol, and the remainder is the text in the label. , annotations, and sub-htmlelement, whereas children simply returns a child htmlelement (a child tag in the usual sense).

ParentNode and parentelement are no different for general elements, but for HTML tags the parent node is the HTMLDocument node, parentelement returns NULL, and parentnode should be used at this time.

Parentelement,chidlren is non-standard, but mainstream browsers are supported.

Node includes: 1.Document 2.CharacterData 3.Attr Document including HTMLDocument characterdata including Text Comment HTMLDocument including HtmlElement and thmlelement is refined to htmltabelelment and so on.

In an HTML document, the document object points to Htmldocument.node, which is the element tree point at which the document starts as an HTML tag

Bo Master's level is limited, hope to find the wrong eldest brother can help point out.

This is casually according to the blogger's own understanding.

ParentNode parentelement childNodes Children

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.