title: Javascript Get Child Element by Name
body: <p>I'm passing a var <code>el</code> into a function. <code>el</code> contains previously grabbed element (using getElementById) and when I console.log <code>el</code> in the function I get the following:</p>
  
  <p><img src="https://i.stack.imgur.com/lsT9R.png" alt="enter image description here"></p>
  
  <p>The problem comes in when I try to grab an element inside of the <code>el</code> using:</p>
  
  <pre><code>el.getElementsByName('fname');
  </code></pre>
  
  <p>I get the error: </p>
  
  <pre><code>Uncaught TypeError: Object #&lt;HTMLDivElement&gt; has no method 'getElementsByName'
  </code></pre>