Hrm...

That doesn't work. I think you might have misunderstood me though. I want to
force the selected attribute of the second option element.

I tried this too:
$('#RedMakeSelect:first-child option:nth-child(1)').attr('selected','true');

And that didn't work either. 

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dan G. Switzer, II
Sent: Tuesday, May 29, 2007 5:54 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Forcing a select box to "select" a specified option


Andy,

>$('#RedMakeSelect:first-child [EMAIL PROTECTED]')

I believe IE always has the value attribute defined--even if it's not
defined in your markup (ie. it essentially adds a value="" to your tag.) If
you know the 2nd element should have a value attribute if it's present, then
I'd just do:

$('#RedMakeSelect:first-child option:nth-child(1)')

-Dan


Reply via email to