手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >jQuery选中select控件 无法设置selected的解决方法
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实现dialog设置focus焦点的方法

jQuery封装的tab选项卡插件分享

jQuery切换所有复选框选中状态的方法

jQuery仿gmail实现fixed布局的方法

js实现文本框选中的方法

Node.js中JavaScript操作MySQL的常用方法整理

JavaScript中length属性的使用方法

jQuery获取页面元素绝对与相对位置的方法

jQuery替换textarea中换行的方法

js获取滚动距离的方法

精品推荐
分类导航