給下拉选项动态设置选中值

$("#unit option").each(function () {
var val = $(this).val();
var text = $(this).text();
if(val=="${model.unit}"){
$(this).attr("selected",true);
}

猜你喜欢

转载自www.cnblogs.com/feathe/p/12517619.html