If your HTML is:
Use:
$("#cmbOperator option[value='" + name + "']").attr('selected', 'selected');
- Selects based on the
value
attribute.
or
$("#cmbOperator option:contains('" + name + "')").attr('selected', 'selected');
- Selects based on the text content.
If your HTML is:
Use:
$("#cmbOperator option:contains('" + name + "')").attr('selected', 'selected');