Search w3schools.com:

SHARE THIS PAGE

DOM Node parentNode Property

Node Object Reference Node Object

Example

Return the parentNode of an <li> element:

document.getElementById("item1").parentNode;

Try it yourself »

Definition and Usage

The parentNode property returns the parent node of the specified node, as a Node object.

Returns null if the the specified node does not have a parent node.

Read more about the Node object in our Node object reference.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The parentNode property is supported in all major browsers.


Syntax

node.parentNode

Technical Details

Return Value: The parent-node of a node, as a Node object
DOM Version Core Level 1


Node Object Reference Node Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]