How to set focus on a dropdown list named -javascript / jquery
I do not have a drop-down list as shown below.
<select name="dropname[0]">....</select>
<select name="dropname[1]">....</select>
<select name="dropname[2]">....</select>
<select name="dropname[3]">....</select>....
Now I want to set the focus to the second drop-down list. I tried these
document.getElementsByName('dropname')[1].focus();
returns this error
TypeError: document.getElementsByName(...)[1] is undefined
Thank you in advance
+4
3 answers