Skip to main content
Active reading. Removed meta information (this belongs in comments).
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

I know this question has been answered, but hereHere is how I would do it:

$("#target option") .removeAttr('selected') .find(':first') //you You can also use .find('[value=MyVal]') .attr('selected','selected'); 

I know this question has been answered, but here is how I would do it

$("#target option") .removeAttr('selected') .find(':first') //you can also use .find('[value=MyVal]') .attr('selected','selected'); 

Here is how I would do it:

$("#target option") .removeAttr('selected') .find(':first') // You can also use .find('[value=MyVal]') .attr('selected','selected'); 
Source Link
Fabrizio
  • 3.8k
  • 2
  • 31
  • 34

I know this question has been answered, but here is how I would do it

$("#target option") .removeAttr('selected') .find(':first') //you can also use .find('[value=MyVal]') .attr('selected','selected');