Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<h1>The Element Object</h1>
<h2>The parentNode Property</h2>
<ul>
  <li id="myLI">Coffee</li>
  <li>Tea</li>
</ul>
<p>The node name of the parent node of "myLI" is:</p>
<p id="demo"></p>
<script>
let name = document.getElementById("myLI").parentNode.nodeName;
document.getElementById("demo").innerHTML = name;
</script>
</body>
</html>