If i have a dropdown list that looks like this:
<select id="select">
<option value="Armoire">Armoire</option>
<option value="Bridge Bed">Brigde Bed</option>
<option value="Bunk Bed">Bunk Bed</option>
</select>
Is it possible to get the value at an specific position? For example:
var b=select.getValueAt(1);
so that b would equal to “Bridge Bed”. That would be the right line for regular java code. Is there anyway to do this using javascript?
Thanks in advance,
The select element has an property called options which is an array of all the option tags it contains
To get the value of element at index one use
Select Object
Fiddle