title: How to change options in select tag in javascript using console?
body: <pre><code>&lt;select name="ethinicity" &gt;
              &lt;option value="type1"&gt;Asian&lt;/option&gt;
              &lt;option value="type2"&gt;African&lt;/option&gt;
              &lt;option value="type3"&gt;Caucasion&lt;/option&gt;
              &lt;option value="type4"&gt;Hispanics&lt;/option&gt;
              &lt;option value="type5"&gt;Other Populated Groups&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>I am using</p>
  
  <pre><code>document.getELementsByname("ethinicity").value="type2"
  </code></pre>
  
  <p>to change its value,but it donot work in that way,why i can't do like this? and give me other way to do this but i donot want to put this in <code>form</code> and then changing it like</p>
  
  <pre><code>document.formName.ethinicity.value="type2"
  </code></pre>
  
  <p>Thanks in advance!</p>