jquery对同级的td做radio限制
<html>
<head>
<title></title>
<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
<script type="text/javascript">
function CheckSex1(str){
alert(str);
var rs = $(".ra");
rs.attr("disabled","disabled");
}
function CheckSex(str){ $(":radio").removeAttr("disabled"); $("tr .woman").prev(":radio").removeAttr("checked");
$("tr .man").prev(":radio").removeAttr("checked");
$("tr .hraf").prev(":radio").removeAttr("checked");
if(str == "man"){
var te = $("tr .woman"); var ra = te.prev(":radio");
ra.attr("disabled","disabled"); }else if(str == "woman"){
var te = $("tr .man"); var ra = te.prev(":radio");
ra.attr("disabled","disabled");
}
} </script>
<body> <table border="1" align="center" class="tyouhyou_11pt" cellpadding="0" cellspacing="0" width="530"> <tr class="tyouhyou_9pt" height="20">
<td width="30" align="center"><input type="radio" name="checkStaff" value="" onclick="CheckSex('man');"/></td>
<td width="90" align="center"><a onclick="jumpNewWindow('xx')"></a></td>
<td width="30" align="center">20</td>
<td width="30" align="center">man</td>
<td width="90" align="center">13545810125</td>
<td width="90" align="center">027-51879974</td>
<td width="90" align="center">2015-01-24</td>
<td width="80" align="center">1</td>
</tr>
<tr class="tyouhyou_9pt" height="20">
<td width="30" align="center"><input type="radio" name="checkStaff" value="" onclick="CheckSex('woman');"/></td>
<td width="90" align="center"><a onclick="jumpNewWindow('xx')"></a></td>
<td width="30" align="center">20</td>
<td width="30" align="center">woman</td>
<td width="90" align="center">13545810125</td>
<td width="90" align="center">027-51879974</td>
<td width="90" align="center">2015-01-24</td>
<td width="80" align="center">1</td>
</tr>
</table> <table border="1" align="center" class="tyouhyou_11pt" cellpadding="0" cellspacing="0" width="530">
<tr class="tyouhyou_9pt" height="30">
<td width="120" align="center" bgcolor="#FFB56A">neirong</td>
<td width="145" align="center">mingzi</td>
<td width="120" align="center" bgcolor="#FFB56A">changsuo</td>
<td width="145" align="center">yewuming</td>
</tr> <tr class="tyouhyou_9pt" height="30">
<td align="left" colspan="4">2015-05-25</td>
</tr> <tr class="tyouhyou_9pt" height="30">
<td align="left" colspan="4"> 08:18-19:00 <input type="radio" class="ra" name="344963duty" value="344952" /> </td>
</tr>
<tr class="tyouhyou_9pt" height="30">
<td align="left" colspan="4"> 09:18-20:00 <input type="radio" class="ra" name="344963duty" value="344952" />
<input type="hidden" class="woman" value="2"/>
</td>
</tr> <tr class="tyouhyou_9pt" height="30">
<td align="left" colspan="4">2015-05-26</td>
</tr> <tr class="tyouhyou_9pt" height="30">
<td align="left" colspan="4"> 10:18-19:00 <input type="radio" class="ra" name="344963duty" value="344952" />
<input type="hidden" class="man" value="1"/>
</td>
</tr>
<tr class="tyouhyou_9pt" height="30">
<td align="left" colspan="4"> 13:18-20:00 <input type="radio" class="ra" name="344963duty" value="344952" />
<input type="hidden" class="woman" value="2"/>
</td>
</tr>
<tr class="tyouhyou_9pt" height="30">
<td align="left" colspan="4"> 18:18-20:00 <input type="radio" class="ra" name="344963duty" value="344952" />
<input type="hidden" class="hraf" value="3"/>
</td>
</tr>
</table>
</body>
</html>
能够实现,控制同级的td中的radio 的可选和不可选
jquery对同级的td做radio限制的更多相关文章
- jquery 单击table行事件和radio的选中事件冲突
原文地址:http://zhidao.baidu.com/link?url=HER7lu4jqejWUhWQO2nq6LZ6tf7vyhPZRADSL-xaBQSF4P4yftD9vg08Ss8HF- ...
- jQuery操作Table tr td常用的方法
虽然现在DIV+CSS进行页的布局大行其道,但是很多地方使用table还是有很多优势,用table展示数据是比较方便的,下面汇总了jQuery操作Table tr td常用的方法,熟记这些操作技巧,下 ...
- 汇总常用的jQuery操作Table tr td方法
虽然现在DIV+CSS进行页的布局大行其道,但是很多地方使用table还是有很多优势,用table展示数据是比较方便的,下面汇总了jQuery操作Table tr td常用的方法,熟记这些操作技巧,下 ...
- jquery 设置checked="checked"无效,radio未选中。。
jquery 设置checked="checked"无效,radio未选中.. 最好还是使用.prop(),在jQuery1.6版本之前.attr存在一些bug.在1.6之后它会自 ...
- [转] jQuery源码分析-如何做jQuery源码分析
jQuery源码分析系列(持续更新) jQuery的源码有些晦涩难懂,本文分享一些我看源码的方法,每一个模块我基本按照这样的顺序去学习. 当我读到难度的书或者源码时,会和<如何阅读一本书> ...
- 11.8 开课二个月零四天 (Jquery取属性值,做全选,去空格)
1.jquery取复选框的值 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "htt ...
- 用jquery修改默认的单选框radio或者复选框checkbox选择框样式
默认的radio和checkbox选框很难看.我去看了一下qq注册的页面.发现单选和复选框并没有用<input>,居然是用是A标签.然后用css背景图片展示选择框,用JavaScript控 ...
- Jquery操作select、checkbox、radio详细讲解
一 .Select jQuery获取Select选择的Text和Value: 1. $("#select_id").change(function(){//code...}); / ...
- jquery从tr获取td
已知HTML:<tr id="row001"><td>001</td><td>张三</td></tr>JQU ...
随机推荐
- 转:gpio_direction_output 与 gpio_set_value
gpio_set_value(port_num,0/1) 一般只是在这个GPIO口的寄存器上写上某个值,至于这个端口是否设置为输出,它就管不了! 而gpio_direction_output (por ...
- BZOJ 1032 祖玛
Description 这是一个流行在Jsoi的游戏,名称为祖玛.精致细腻的背景,外加神秘的印加音乐衬托,彷佛置身在古老的国度里面,进行一个神秘的游戏——这就是著名的祖玛游戏.祖玛游戏的主角是一只石青 ...
- 【技术贴】7-zip 7z关联右键菜单后右键不弹出菜单的解决办法
解决7z,7zip右键菜单 失效 右键菜单 无法弹出右键菜单 不正常 右键菜单 sb等各种疑难杂症. 1.首先先去7z的选项里面把右键关联给设置了. 用的好好的7z,正吃着火锅唱着歌忽然发现右键单文件 ...
- c#语句 (随堂练习)
1. 方程ax²+bx+c=0:一元二次方程.求根 输入a,b,c的值 Δ=b²-4ac:若Δ<0方程无实根 若Δ>0,方程有两个不相同的实根x1 x2gen 若Δ ...
- 比较全面的gdb调试命令 (转载)
转自http://blog.csdn.net/dadalan/article/details/3758025 用GDB调试程序 GDB是一个强大的命令行调试工具.大家知道命令行的强大就是在于,其可以形 ...
- AC+DP练习
1.HDU 2222 Keywords Search 求目标串中出现了几个模式串. #include<iostream> #include<cstdio> #include&l ...
- Javascript面向对象编程(二):构造函数的继承 by 阮一峰
今天要介绍的是,对象之间的"继承"的五种方法. 比如,现在有一个"动物"对象的构造函数. function Animal(){ this.species = & ...
- Ubuntu 12.04 下安装 Eclipse
方法一:(缺点是安装时附加openjdk等大量程序并无法去除,优点是安装简单) $ sudo apt-get install eclipse 方法二:(优点是安装内容清爽,缺点是配置麻烦)1.安装JD ...
- 数据结构之顺序栈SqStack
顺序栈SqStack 基本操作 Status InitStack()//构造一个空栈S Status DestroyStack()//销毁栈S,S不再存在 Status ClearStack()//把 ...
- 暴力求解——除法 Division,UVa 725
Description Write a program that finds and displays all pairs of 5-digit numbers that between them u ...