[jQuery] Re: How to get option's position

2009-06-09 Thread huytoan.pc
$('option').click(function(){ var index = $('option').index(this) + 1; //index() will return zero based result so plus 1 here }); On Jun 9, 8: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

[jQuery] Re: How to get option's position

2009-06-08 Thread RobG
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 optiona/option optionb/option optionc/option /select Select elements have a (zero