Get element's parent node : parentNode « DOM Node « JavaScript Tutorial






<html>
<head>
<title>removeChild() Example</title>
<script type="text/javascript">
    function removeMessage() {
        var oP = document.body.getElementsByTagName("p")[0];
        oP.parentNode.removeChild(oP);
    }
</script>
</head>
<body onload="removeMessage()">
<P>A</p>
<P>B</p>
<P>C</p>
</body>
</html>








23.18.parentNode
23.18.1.Get element's parent node