jQuery选中select控件无法设置selected的解决方法
2023-06-13 09:14:24 时间
解决办法:把选中option的语句放到setTimeout中,例:
复制代码代码如下:
setTimeout(function(){
varselSorts=$("select[id^=""+controls.selsort+""]");
$.each(selSorts,function(index,sort){
varope=$(sort).find("option[value=""+arrSort[index]+""]");
if(ope.length>0)
ope[0].selected=true;
});
},1);
相关文章
- JQuery中操作Css样式的方法大全详解编程语言
- jQuery offset()和position()方法
- jQuery事件队列调整方法
- jQuery跨域访问问题解决方法
- jQuery中fadeIn、fadeOut、fadeTo的使用方法(图片显示与隐藏)
- 利用div+jquery自定义滚动条样式的2种方法
- jquery添加节点的几种方法介绍
- jquery缓存问题的几个解决方法
- jquery上传插件fineuploader上传文件使用方法(jquery图片上传插件)
- jQuery:delegate中select()不起作用的解决方法(实例讲解)
- jQuery获得IE版本不准确webbrowser的解决方法
- jquery库或JS文件在eclipse下报错问题解决方法
- JQuery的Ajax中Post方法传递中文出现乱码的解决方法