The current code I have is as follows:
function SetDefaultCarrier(orderCarrier) {
$("#carrierdropdown option:contains(" + orderCarrier + ")").attr('selected', true);
}
The issue is that this will select the first option found in the list which contains the string orderCarrier
. For instance, if orderCarrier
is "UPS IG", the function will sometimes select the value "UPS IG C" since the former is a substring of the latter. How do I make it only select an exact match?