title: Javascript select the child by the parents id
body: <p>sorry if this question has already been asked but how can i select a child(li) by the parents(ul) id?
  code:</p>
  
  <pre><code>    &lt;ul onmouseover="openNav()" onmouseout="closeNav()" id="nav"&gt;
          &lt;li&gt;&lt;a href="link1.html"&gt;Link 1&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;Link 2&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;Link 3&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  
  function openNav(){
     //document.getElementById('nav').style.height = '65px'; &lt;-- this is working
     document.getElementById('nav').childNodes.style.opacity = '1';
  }
  </code></pre>
  
  <p>I've already tried this:</p>
  
  <pre><code>document.getElementById('nav').getElementsByTagName('li').style.opacity = '1';
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>document.getElementById('nav').childNodes.style.opacity = '1';
  </code></pre>
  
  <p>and a few other but none is working pls help me!!
  Thanks for all answers :)</p>