On Jun 9, 11:23 am, "David .Wu" <chan1...@gmail.com> wrote:
> if I have a menu, how to get the position of the option after I select
> one of it?
>
> for example, if I choose b, and the position should b 2.
> <select>
> <option>a</option>
> <option>b</option>
> <option>c</option>
> </select>

Select elements have a (zero indexed) selectedIndex property that
tells you which option is selected.  If no option is selected, it has
a value of -1.

If b is selected above, the select's selectedIndex property will
return 1.


--
Rob

Reply via email to