On 31/01/07, Dmitrii 'Mamut' Dimandt <[EMAIL PROTECTED]> wrote:
> How do I access dollarified object's DOM properties without using each()?
>
> That is, let's say, I have a select on my page:
>
> <select id="myselect">
>     <option value="1">1</option>
>     <option value="2">2</option>
> </select>
>
>
> How can I access its selectedIndex property without resorting to
> $("myselect").each(
>     function(){
>         this.selectedIndex
>     }
> );
>
> ?

A jQuery object is a pseudo array, so you can do:

$("#myselect")[0].selectedIndex

You can get the selected options (if that is what you are trying to do) with:

$("#myselect option:selected")

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to