title: JavaScript Not able to set focus to first li element within ul
body: <p>I have below code:</p>
  
  <pre><code>&lt;ul id='someId'&gt;
   &lt;li class='someClass'&gt;
   &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>I want to set focus on first li element within ul based on some condition.</p>
  
  <p>My first attempt is like this:</p>
  
  <pre><code>var ul = document.getElementById('someId');           
  var child = ul.childNodes[0];
  child.focus();
  </code></pre>
  
  <p>My second attempt is like this :</p>
  
  <pre><code>var y = document.getElementsByClassName('someClass');
  var aNode = y[0];
  aNode.focus();
  </code></pre>
  
  <p>But none of the above works</p>
  
  <p>Any ideas?</p>