If nodeA is the root element, then
nodeA.offsetParent
returns null.
If nodeA is the HTML body element, then
nodeA.offsetParent
returns null.
If the computed value of the position property for nodeA
is fixed, then nodeA.offsetParent
returns null.
If nodeA is an area HTML element which has a map HTML
element somewhere in the ancestor chain, then
nodeA.offsetParent
returns null because the map element does not have an
associated CSS layout box.
If the computed value of the position property of the nearest
ancestor of nodeA is not static, then
nodeA.offsetParent
returns such ancestor.
nodeA.offsetParent
is the HTML body element.If nodeA's ancestors are not td HTML
element, not th HTML element, not table HTML element and
nodeA's ancestors within the containment hierarchy are all
position static and nodeA is within the document containment
hierarchy, then nodeA.offsetParent
return [object
HTMLBodyElement].
If an ancestor of nodeA is the td HTML element, then
nodeA.offsetParent
returns [object
HTMLTableCellElement].
<td><p id="PInsideTD">Hello</p></td> |
If an ancestor of nodeA is the th HTML element, then
nodeA.offsetParent
returns [object
HTMLTableCellElement].
<th><p id="PInsideTH">Hello</p></th> |
---|
If an ancestor of nodeA is the table HTML element, then
nodeA.offsetParent
returns [object HTMLTableElement].
Hello |
---|
IE 7 | IE 8 RC1 | Firefox 2 | Firefox 3 | Opera 9.50 | Safari 3.1.1 | Konq 4.1.2 | |
---|---|---|---|---|---|---|---|
IE 7 | IE 8 RC1 | Firefox 2 | Firefox 3 | Opera 9.50 | Safari 3.1.1 | Konq 4.1.2 | |
1st test | Passes | Passes | Passes | Passes | Passes | Passes | Passes |
2nd test | Passes | Passes | Passes | Passes | Passes | Passes | Passes |
3rd test | Passes | Passes | Fails | Fails | Passes | Fails | Passes |
4th test | Fails | Passes | Fails | Fails | Fails | Fails | Fails |
5th test | Passes | Passes | Passes | Passes | Passes | Passes | Passes |
6th test | Passes | Passes | Passes | Passes | Passes | Passes | Passes |
7th test | Passes | Passes | Passes | Passes | Passes | Passes | Passes |
8th test | Passes | Passes | Passes | Passes | Passes | Passes | Passes |
9th test | Passes | Passes | Passes | Passes | Passes | Passes | Passes |