title: Get ID of parent element on click
body: <p>I'm trying to display ID of parent <code>UL</code> on <code>LI</code> click. but the alert is displaying value as undefined. Where am I going wrong?</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;ul id='uiID'&gt;
      &lt;li id='myLi'&gt;A&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>JavaScript</p>
  
  <pre><code>var x = document.getElementById("myLI").parentNode.nodeName;
  alert(x.id);
  </code></pre>