0

I m using this method to select a value on mvc dropdown.

$("#orgCreate #country option:contains(Sri Lanka)").attr('selected', 'selected');

First time this is ok. But when I try again. Its not select correct value. Is there is a method to deselect or how can I solve this problem.

user2901979
  • 239
  • 2
  • 6
  • 13

1 Answers1

0

Use ,

$("#country option:contains(Sri Lanka)").prop('selected', true);
Deepak Ingole
  • 14,912
  • 10
  • 47
  • 79