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

时间:2010-09-01    点击:400   
解决办法:把选中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的6个Tab选项卡插件
Jquery中dialog属性小记
javascript中使用css需要注意的地方小结
js截取函数(indexOf,join等)
qTip 基于JQuery的Tooltip插件[兼容性好]
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved