关于jq操作table下多个type=radio的input的选中
假如有2个table:
<table id="table1" border="0">
<tr>
<td><input id="rdu_0" type="radio" name="rdu" value="1" checked="checked" /><label for="rdu_0">第一个</label></td>
</tr><tr>
<td><input id="rdu_1" type="radio" name="rdu" value="2" /><label for="rdu_1">第2个</label></td>
</tr><tr>
<td><input id="rdu_2" type="radio" name="rdu" value="3" /><label for="rdu_2">第3个</label></td>
</tr>
</table>
<table id="table2" border="0">
<tr>
<td><input id="rrr_0" type="radio" name="rrr" value="1" checked="checked" /><label for="rrr_0">第一个</label></td>
</tr><tr>
<td><input id="rrr_1" type="radio" name="rrr" value="2" /><label for="rrr_1">第2个</label></td>
</tr><tr>
<td><input id="rrr_2" type="radio" name="rrr" value="3" /><label for="rrr_2">第3个</label></td>
</tr>
</table>
在第一个table中的某个input选中之后,第二个table的所有input全部未选中
<script type="text/javascript">
$("#table1").find("input").click(function(){ //给table下的所有input加click事件
$("#table2").find("input").each(function(){//遍历所有table2下的input
$(this).attr("checked","");
})
})
</script>
关于jq操作table下多个type=radio的input的选中的更多相关文章
- jquery操作select下拉框的各种方法,获取选中项的值或文本,根据指定的值或文本选中select的option项等
简介jquery里对select进行各种操作的方法,如联动.取值.根据值或文本来选中指定的select下拉框指定的option选项,读取select选中项的值和文本等. 这一章,站长总结一下jquer ...
- 定制 input[type="radio"] 和 input[type="checkbox"] 样式
表单中,经常会使用到单选按钮和复选框,但是,input[type="radio"] 和 input[type="checkbox"] 的默认样式在不同的浏览器或 ...
- 修改 input[type="radio"] 和 input[type="checkbox"] 的默认样式
表单中,经常会使用到单选按钮和复选框,但是,input[type="radio"] 和 input[type="checkbox"] 的默认样式在不同的浏览器或 ...
- <input type="radio" >与<input type="checkbox">值得获取
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"% ...
- 点击DIV触发其他元素的点击事件(案例:点击type="radio" 的input 标签外层DIV,触发内部单选点击选中事件)
方法一: 直接用找到对应dom元素调用.click()方法 $('.user_content').click(function(){ $(this).children()[0].click(); // ...
- jq 操作table
转载于:http://www.jb51.net/article/34633.htm jquery获取table中的某行全部td的内容方法,需要的朋友可以参考一下 <table>< ...
- jq操作table追加td
示例 代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF ...
- jq遍历table 下的 td 添加类
<script> $('#btntb').click(function () { $('#tab tr').each(function (i) { // 遍历 tr $(this).chi ...
- Jquery操作select,radio,input,p之类
select的操作 变化后触发操作 $("#txtaddprojecturl").change(function(){ $("#addprojectname") ...
随机推荐
- 三点顺序_nyoj_68(计算几何).java
三点顺序 时间限制: 1000 ms | 内存限制: 65535 KB 难度: 3 描述 现在给你不共线的三个点A,B,C的坐标,它们一定能组成一个三角形,现在让你判断A,B,C是顺时针给出的 ...
- #include <cstdarg>
实现可变参数 #include <iostream> #include <cstdarg> using namespace std; template <typename ...
- 安装python模块
要想在python中使用import的一些模块,前提是要安装这些模块. 可以使用pip来导入模块. 打开终端,输入命令: sudo easy_install pip 安装好pip后,就可以使用pip来 ...
- poj 1094 Sorting It All Out(图论)
http://poj.org/problem?id=1094 这一题,看了个大牛的解题报告,思路变得非常的清晰: 1,先利用floyd_warshall算法求出图的传递闭包 2,再判断是不是存在唯一的 ...
- Choosing Between ElasticSearch, MongoDB & Hadoop
An interesting trend has been developing in the IT landscape over the past few years. Many new tech ...
- WINFORM中几句程序获取整个屏幕的图片及当前窗口的图片快照
/// <summary> /// 获取整个屏幕的图片 /// </summary> /// <returns></returns ...
- 简单的CSS网页布局--三列布局
三列布局其实不难,不过要用到position:absolute这个属性,因为这个属性是基于浏览器而言,左右部分各放在左右侧,空出中间一列来实现三列布局. (一)三列布局自适应 <!DOCTYPE ...
- JavaScript引用类型之Array类型一
一.简介 除了Object之外,Array类型恐怕是ECMAScript中最常用的类型了.下面就来分析ECMAScript中的数组与其他语言中的数组的异同性: 1.相同点: (1)他们都是数据的有序列 ...
- C#Excel导出导入
using System; using System.Collections.Generic; using NPOI; using NPOI.HPSF; using NPOI.HSSF; using ...
- [转]spring 监听器 IntrospectorCleanupListener简介
"在服务器运行过程中,Spring不停的运行的计划任务和OpenSessionInViewFilter,使得Tomcat反复加载对象而产生框架并用时可能产生的内存泄漏,则使用Introspe ...