parentNode
In this chapter you will learn:
Parent node
Each node has a parentNode
property pointing to its parent.
<!DOCTYPE html><!--from j a v a 2s.com-->
<html>
<body>
<div id="div1">
<p>Hello <b>World!</b></p>
<ul>
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ul>
</div>
<p>Hello <b>World!</b></p>
<script type="text/javascript">
var div = document.getElementById("div1");
var node = div.parentNode;
document.writeln(node);
</script>
</body>
</html>
Next chapter...
What you will learn in the next chapter: