I thought a jQuery object consisted of extended DOM objects - i.e. all DOM methods and properties are available, plus the jQuery extensions.
On 3/24/07, Brian Cherne <[EMAIL PROTECTED]> wrote:
var valueOfSelected = $("#list [EMAIL PROTECTED]").val(); And, instead of onClick you probably want to use onChange. Note, when you are in the function "this" refers to the DOM object that fired the event (that has selectedIndex). When you wrap it in $(this) you then have the jQuery object (which does not have selectedIndex, but can be used for all other jQuery events/methods). I hope this helps, Brian. On 3/24/07, narven <[EMAIL PROTECTED]> wrote: > Hi, > > > > Im having some problems getting the value of selectedIndex of a select > box. > > > > im using... > > > > > > // this is populated dynamic using ajax > > <select id="list" name="list" size="15"></select> > > > > $(function() { > > > > $('#list').bind('click', function() { > > alert( $(this).selectedIndex ); > > }); > > > > > > }) > > > > > > But always gives me undefined :| > > _______________________________________________ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > > _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
-- Rob Desbois Eml: [EMAIL PROTECTED] Tel: 01452 760631 Mob: 07946 705987 "There's a whale there's a whale there's a whale fish" he cried, and the whale was in full view. ...Then ooh welcome. Ahhh. Ooh mug welcome.
_______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/