您的位置:首页 > Web前端 > JQuery

jQuery选中select控件 无法设置selected的解决方法

2010-09-01 00:00 776 查看
解决办法:把选中option的语句放到setTimeout中,例:
setTimeout(function() { 
var selSorts = $("select[id^='" + controls.selsort + "']"); 
$.each(selSorts, function(index, sort) { 
var ope = $(sort).find("option[value='" + arrSort[index] + "']"); 
if (ope.length > 0) 
ope[0].selected = true; 
}); 
}, 1);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: