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