HTML DOM parentNodeProperty
Examples
Return the parent node of the <li> element:
document.getElementById("item1").parentNode;
Try it yourself »
Definition and Usage
The parentNode property can return the parent node of a node.
If the specified node has no parent node, it returns null.null 。
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the parentNode property.
Syntax
node.parentNode
Technical Details
| Return value: | Returns the parent node as a node object. |
|---|---|
| DOM Version | Core Level 1 Node Object |
Other Extensions
Element Object