You may also try
$("#select [EMAIL PROTECTED]'whatever']") to select by id
or if multiple selection was allowed, to get all selected options use
$("#select [EMAIL PROTECTED]").doSomethingWithThem();
On Aug 23, 11:18 pm, "Steve Finkelstein" <[EMAIL PROTECTED]> wrote:
> Hiya Karl!
>
> Thanks for the reply. Just for those who might be searching the archives in
> the future, I figure I'd also give some useful insight. I haven't tried
> Karl's method, but I did run
> intohttp://www.texotela.co.uk/code/jquery/select/.
>
> I have some variables set after the DOM is loaded:
>
> var currentMakeSel = $("#make").val();
> var currentModelSel = $("#model").val();
> var currentTrimSel = $("#trim").val();
>
> Then I just roll:
>
> $("select#make").selectOptions(currentMakeSel);
> $("select#model").selectOptions(currentModelSel);
> $("select#trim").selectOptions(currentTrimSel);
>
> Thanks again and I hope this helps someone!
>
> - sf
>
> On 8/24/07, Karl Swedberg <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Aug 23, 2007, at 11:11 PM, Steve Finkelstein wrote:
>
> > > I'm trying to select an option in a successful callback function using
> > > the following syntax:
>
> > > $('select#make > option').('#null').attr({ selected: "selected" });
>
> > > Does anyone here see what's wrong?
>
> > Yes, this part:
> > .('#null')
>
> > Is that supposed to be the id of one of the options? if so, you could
> > write it like this:
>
> > $('#null').attr({ selected: "selected" });
>
> > Since IDs are unique, no need to give it context.
>
> > --Karl
> > _________________
> > Karl Swedberg
> >www.englishrules.com
> >www.learningjquery.com