jQuery选中select控件 无法设置selected的解决方法
摘要:解决办法:把选中option的语句放到setTimeout中,例:复制代码代码如下:setTimeout(function(){varsel...
解决办法:把选中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);
【jQuery选中select控件 无法设置selected的解决方法】相关文章:
★ jQuery实现限制textarea文本框输入字符数量的方法
★ JS或jQuery获取ASP.NET服务器控件ID的方法