HTML DOM parentNodeProperty

元素对象参考手册Element Object

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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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


元素对象参考手册Element Object

Other Extensions