Parentelement gets the parent object in the object hierarchy.
ParentNode gets the parent object in the document hierarchy.
ChildNodes gets a collection of HTML elements and Textnode objects that are direct descendants of the specified object.
Children gets a collection of DHTML objects that are direct descendants of an object.
--------------------------------------------------------
Like ParentNode and parentelement functions, childnodes and children function as well. But ParentNode and childnodes are consistent with the standard of the Global Consortium, which can be said to be more generic. While the other two are only IE support, not the standard, Firefox does not support
--------------------------------------------------------
Use this parentnode,childnodes 2 to be OK. The upstairs are all positive solutions!
--------------------------------------------------------
Is it just a different standard?
--------------------------------------------------------
This is not "standard",
The other two is not a standard at all,
Can be understood as IE customization
--------------------------------------------------------
That is to say parentelement, children is ie own thing, the other place is not recognized.
Well, their standard version is parentnode,childnodes.
These two functions are the same as parentelement and children, and are standard and universal.
--------------------------------------------------------
Here is a simple explanation to note the differences in individual words:
ParentNode property:retrieves The Parent object in the document hierarchy.
Parentelement Property:retrieves The Parent object in the object hierarchy.
ChildNodes:
Retrieves a collection of HTML Elements and Textnode objects that are direct descendants of the the specified object.
Children
Retrieves a collection of DHTML Objects that are direct descendants of the object.
--------------------------------------------------------
I also took two paragraphs from the DHTML manual ^_^
Parentelement Children:
There is no public standard the applies to this property/collection.
ParentNode childnodes:
This is defined into world Wide Web Consortium (property/collection) Document Object Model (DOM) Level 1.
Many of the standards for the standard of the consortium began to support IE5
IE4 used to only use IE's own method
============================================
<div id= "Test1" > bbb<div>aaa</div> <div>aaa</div> </div> <script> alert ( document.getElementById ("Test1"). Childnodes.length); Alert (document.getElementById ("Test1"). Children.length); </script>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
See, this BBB here, it's affecting the results.