Offsetparent directly affects the upper-level element of the element position, while the upper-level element in the Dom is irrelevant to the position display.
For example:
< Body >
< Div Style = "Border: 1px solid black; position: absolute ;" >
< Form >
< Input Type = "Checkbox" ID = "Cc" />
</ Form >
</ Div >
</ Body >
In this example, the offsetparent of the "cc" element is Div. If the position attribute of the DIV is removed, the CC offsetparent will be changed to the body. While parentelement is always form.
There are also offsetleft and offsettop attributes, which indicate the distance between the left and top of the element.
The parentnode and parentelement functions the same, while the childnodes and Children functions the same. However, parentnode and childnodes comply with W3C standards and are more common. The other two are only supported by IE, but not by Firefox.