Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM parentNode Property

HTML DOM parentNode Property

Element Object Reference Element object

Example

Return

  • Parent node of the element:

    document.getElementById("item1").parentNode;

    Try it »


    Definition and Usage

    The parentNode property returns the parent node of a node.

    If the specified node has no parent node, it returns 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 Reference Element object