[jQuery] changing the selected option in a select

[jQuery] changing the selected option in a select


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-tp15345354s27240p15345354.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.