I have a select control, and in a javascript variable I have a text string.
Using jQuery I want to set the selected element of the select control to be the item with
$("#Test").find("option:contains('two')").each(function(){ if( $(this).text() == 'two' ) { $(this).attr("selected","selected"); } });
The if statement does a exact match with "two" and "two three" will not be matched