select标签根据option选中:
text = "x";
$("#id").find("option").each(function (data) {
var $this = $(this);
if($this.text() == text) {
$this.attr("selected", true);
}
});
这样的话也可以根据value选中:
value = "1";
$("#id").find("option").each(function (data) {
var $this = $(this);
if($this.val() == value) {
$this.attr("selected", true);
}
});