title: How to query nested level DOM using javascript and recursive
body: <p>I have an issue like this and still cant find a solution for it. </p>
  
  <p>I have a DOM query like this</p>
  
  <pre><code>#someid .someclass p
  </code></pre>
  
  <p>Below is the DOM</p>
  
  <pre><code>&lt;div id='someid'&gt;
    &lt;div class='someclass'&gt;
      &lt;p&gt;
       some text
      &lt;/p&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I query the p element by just using these 3 API</p>
  
  <pre><code>document.getElementById
  document.getElementsByClassName
  document.getElementsByTagName
  </code></pre>
  
  <p>I want to use recursive in this case until I can get the p element</p>
  
  <p>Thanks everyone for your guidance.</p>