If I had the following select, and did not know the value to use to select an item in advance like in this question or the index of the item I wanted selected, how could I s
function SelectItemInDropDownList(itemToFind){
var option;
$('#list option').each(function(){
if($(this).text() == itemToFind) {
option = this;
option.selected = true;
return false;
}
}); }
I only modified the previous code because it only located the option in the select list, some may want a literal demonstration.