$('#yourSelectBox').val(yourvalue); // not work
Therefore, I try the following code to resolve:
$('#yourSelectBox option').each(function () {
if (this.value == yourvalue) {
this.selected = true;
}
});
if (this.value == yourvalue) {
this.selected = true;
}
});
沒有留言:
張貼留言