title: I want to use javascript to insert an attribute to an element
body: <p>Any ideas how I would go about writing a javascript method to insert an attribute to a tag</p>
  
  <p>eg. I have</p>
  
  <pre><code>&lt;input id='in1' value='Submit' type='submit'/&gt;
  </code></pre>
  
  <p>and I want to insert an attribute name</p>
  
  <pre><code>&lt;input id='in1' name='submit_content' value='Submit' type='submit'/&gt;
  </code></pre>
  
  <p>Thanks </p>