DOM - Parent Node
Table of Contents
About
This article shows how to get the parent of a DOM node
Example
parentNode
The parentNode retrieve all type of node|node
<p><span id="child">Child</span></p>
spanElement = document.getElementById("child");
parentNode = spanElement.parentNode;
console.log("The parent node is a "+(parentNode.nodeType==1 ? "element" : "Unknown"));