title: How to set focus on dropdown by its name -javascript/jquery
body: <p>I have a no of dropdown list as follows</p>
  
  <pre><code>&lt;select name="dropname[0]"&gt;....&lt;/select&gt;
  &lt;select name="dropname[1]"&gt;....&lt;/select&gt;
  &lt;select name="dropname[2]"&gt;....&lt;/select&gt;
  &lt;select name="dropname[3]"&gt;....&lt;/select&gt;....
  </code></pre>
  
  <p>Now I want to set focus on second drop down list.I tried these</p>
  
  <pre><code>document.getElementsByName('dropname')[1].focus();
  </code></pre>
  
  <p>results this error</p>
  
  <pre><code>TypeError: document.getElementsByName(...)[1] is undefined
  </code></pre>
  
  <p>Thanks in advance</p>