title: JavaScript setAttribute not working
body: <p>I've been trying to use setAttribute to change the name of the select tag from the oldName to the newName, however when I load the page and then look at the source, the oldName remains. Ultimately, I wanted to add an attribute "onchange","function();" but I can't even get the JS to change the name of the tag. Any help would be appreciated. Thanks in advance. I tested this on Mac OS X: Chrome, FF, and Safari.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
          &lt;select name="oldName"&gt;
          &lt;option value="0"&gt;Essay 1&lt;/option&gt;
          &lt;option value="1"&gt;Essay 2&lt;/option&gt;
          &lt;option value="2"&gt;Essay 3&lt;/option&gt;
          &lt;/select&gt;
  &lt;script type="text/javascript"&gt;
  document.getElementsByTagName("select").item(0).setAttribute("name","newName");
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>