根据文本绑定text
for (var i = 0; i < countCity; i++) {
if ($("#slCity").get(0).options[i].text == locationCity) {
$("#slCity").get(0).options[i].selected = true;
break;
}
}
if ($("#slCity").get(0).options[i].text == locationCity) {
$("#slCity").get(0).options[i].selected = true;
break;
}
}
根据值绑定value