Try this:

this didn't work (as well as several other variations):
$('a.cancel').click( function(){
    $('select option:nth(0)').attr("selected","selected");
});

On 7. Feb, 23:40 h., rolfsf <[EMAIL PROTECTED]> wrote:
> I can't seem to get this to work...
>
> I'm using jquery 1.1.4
>
> I have a link 'a.clear'
>
> When clicking on a.clear, I want to reset all selects to a 'null' option:
>
> javascript:void(0); clear
>
> <select>
>   <option value="0">--</option>
>   <option value="1" selected="selected">this</option>
>   <option value="2" >that</option>
> </select>
>
> this didn't work (as well as several other variations):
> $('a.cancel').click( function(){
>     $('select option[value=0]').attr("selected","selected");
>
> });
>
> can someone clue me in?
>
> Thanks!
> --
> View this message in 
> context:http://www.nabble.com/changing-the-selected-option-in-a-select-tp1534...
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to