title: get child node by name in javascript
body: <p>How can I get all children of a html tag with a certain name?</p>
  
  <p>Let's assume I have a <code>&lt;div&gt;</code> which looks like this</p>
  
  <pre><code>&lt;div id=test&gt;
      &lt;input name=test1/&gt;
      &lt;input name=test2/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>if I have the div element, how can I get any child with name test1 or test2? I tried </p>
  
  <pre><code>div.getElementsByName('test1')
  </code></pre>
  
  <p>but that does not work?</p>