title: JavaScript getElementByName doesn't work
body: <p>This simple JS can't set the value of "para". I guess getElementByName doesn't work. But why?  </p>
  
  <pre><code>&lt;script&gt;
  function fn()  
  {   
      document.getElementById("para").setAttribute("name","hi");  
      document.getElementByName("hi").setAttribute("value","my value is high");  
  }  
  &lt;/script&gt;
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input type="button" onClick="fn()" value="click me"&gt;
  &lt;input id="para" type="text" /&gt;
  </code></pre>