jquery select 选中问题w
来源:互联网 发布:华润网络福利待遇 编辑:程序博客网 时间:2024/06/05 19:43
<body><div class="memberd main"> <div class="memberrd"> <div class="setupd"> <div class="memformd setauthd"> <div class="row zyfw"> <div id="businessScopeContent" style="margin-left: 215px;"> <select id="business_scope" name="business_scope" class="sel w3" style="width: 157px;"> <option value="">--请选择主营范围--</option> <option value="1">heheh</option><option value="2">heheh1</option><option value="3">heheh2</option><option value="4">heheh3</option> </select></div> </div></div> </div> </div> </div></body>
$("#business_scope option[value='1']").attr("selected", true); //是能把value 为1的选项设置为选择
$("#business_scope option[text='heheh']").attr("selected", true);//是不能把text = 'heheh' 的选项选中
$("#business_scope option:contains('heheh2')").attr('selected', true);//是可以把text = 'heheh2' 的选项选中 但是把所有 包含'heheh2的值都会命中,代替的代码可以这样:
$("#business_scope option:contains('heheh')").map(function(){ if ($(this).text() == "heheh1") { $(this).attr('selected', true); //return this; }});
阅读全文
0 0
- jquery select 选中问题w
- jQuery select 选中问题
- jquery使select选中:
- jquery select 选中
- jquery select 选中值
- jquery 控制 select 选中
- jQuery判断select选中
- jquery select option选中
- jquery实现select选中
- jquery设置select选中
- JQuery<Select>在IE下设置选中问题
- IE8下Jquery获取select选中的值的问题
- IE8下Jquery获取select选中的值的问题
- IE8下Jquery获取select选中的值的问题
- JQuery频繁修改select的选中时的失效问题
- jquery 获取select 选中值
- jquery select 设置默认选中
- jquery select option 动态选中
- 解决浏览器跨域的几种方式
- 在安卓4.x上使用Switch控件,并且替换thumb和track的图片时,Switch展示的width会明显大于设置的宽度,导致图片变形
- hdu1232通畅工程
- DOcker 启动chrome问题解决
- wamp的http:403禁止访问
- jquery select 选中问题w
- gsp页面标签
- git push: error 401 Unauthorized while accessing
- 认识XXXServlet之 DispatcherServlet
- JavaScript运动框架(一):解决速度正负取整问题
- Grunt打包前端代码教程
- 在Android上使用OpenCL调用GPU加速
- CNTK入门01:初次使用和运行第一个例子
- 喷水装置1