jquery选择器之radio 和id
2014-09-17 20:42
260 查看
$(":radio#1").attr("checked");
为了提高效率如下例子
<td class='ui-field-contain'><input type='text' name='actMetric' id='actMetric' data-inline='true'></td> <td class='ui-field-contain'><span style="background-color: rgb(255, 255, 153);"><input type='radio' style='margin-top:5px;' name='checked' id='checked1' data-inline='true'></span></td> <td class='ui-field-contain'><input type='text' name='mainSum' id='mainSum' data-inline='true'></td> <td class='ui-field-contain'><span style="background-color: rgb(255, 255, 153);"><input type='radio' style='margin-top:5px;' name='checked' id='checked2' data-inline='true'></span></td> <td class='ui-field-contain'><input type='text' name='actBakeP' id='actBakeP' data-inline='true'></td>
想利用 :radio 和 #1 (id)选择其中一个例:
$(":radio#1").attr("checked");
试了一下,这样是可行的
同样:
$(":radio[id='1']").attr("checked");
这样也可以!
相关文章推荐
- jQuery的选择器中的通配符[id^='code']
- jQuery的选择器中的通配符[id^='code']
- jQuery的选择器中的通配符[id^='code']
- Jquery -- 常用选择器 和 div/select/radio/checkbox的使用
- 02_Jquery_01_id选择器
- jQuery的ID选择器
- jQuery的选择器中的通配符[id^='code']或[name^='code']
- JQuery中的id选择器含有特殊字符时,不能选中dom元素的解决方法
- jquery通过id或name获取radio选中值
- jquery选择器根据id搜索元素并且批量处理
- jQuery的选择器中的通配符[id^='code']或[name^='code']及jquery选择器总结
- jQuery的标签选择器$('p')、类选择器$('.myClass')、id选择器$('#myId')
- jQuery的选择器中的通配符[id^='code']
- jQuery的选择器中的通配符[id^='code']
- jQuery的选择器中的通配符[id^='code']
- JQuery ID选择器中的不能包含特殊字符(=,@ etc.)
- RadioButtonList jquery获取ID和text
- 1. 总是从ID选择器开始继承 在jquery中最快的选择器是ID选择器. 因为它直接来自于Javascript的getElementById()方法. Traffic Light
- jQuery的选择器中的通配符[id^='code']或[name^='code']及jquery选择器总结
- 转-JQuery选择器及radio,checkbox,select取值和反选