0

I have coded for setting a drop down menu's option to a specific value when the text is known but I have encountered a problem. The following code is what I use:

$('#dropDownId option:contains("' + searchText + '")').prop('selected', true).change();

The contains part of the code won't serve the purpose of the code since the drop down has two options which are sub strings of one another.

Is there a way where I could specify that I want the exact match of the given searchText??

valyrian
  • 195
  • 1
  • 1
  • 11

0 Answers0