请问:如何根据单选框的选择来决定复选框是否可选? 有两个单选框A,B,一个复选框C。想实现的效果是:当选择其中一个单选框A时,复选框C才可选。不知如何实现?谢谢了。。javascript 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script><title>无标题文档</title></head><body><input type="radio" value="a" name="sc" />A<input type="radio" value="b" name="sc" />B<input type="checkbox" value="is" name="msc" disabled="disabled" />choose A Or B<script type="text/javascript">jQuery(function($){ $(':radio[name=sc]').click(function(){ $(':checkbox[name=msc]').removeAttr('disabled'); }); });</script></body></html> 测试了下,好像不行哦,http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js这个文件我没有哦。。 测试了下,好像不行哦,http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js这个文件我没有哦。。你的电脑上不了网?这个是google jquery 的cdn地址。不需要你本地有。只要你能上网,浏览器没有禁用javascript脚本 测试了下,好像不行哦,http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js这个文件我没有哦。。你的电脑上不了网?这个是google jquery 的cdn地址。不需要你本地有。只要你能上网,浏览器没有禁用javascript脚本能上网啊。。没有禁用js脚本啊,我自己写的都可以用的。。 jQuery(function($){ $(':radio[value=a]').click(function(){ $(':checkbox[name=msc]').removeAttr('disabled'); }); $(':radio[value=b]').click(function(){ $(':checkbox[name=msc]').attr('disabled','disabled'); }); });是不是要这个样子的?按我自己的理解改的代码。 没使用JQuery,已经自己搞定了,谢谢各位! 来帮忙看下这个问题,本人不是专业技术人员,前来求高人指教! js实例 js正则表达式 匹配ip组 检测客户端文件~~ 用JavaScript判断浏览器是否支持JavaScript并提示 如何判断两个日期的先后? web 级连菜单 isNaN(num.value)的问题 字符串替换 如何实现用图片(按钮)控制音乐开关 求助 急 js替换字符串问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<title>无标题文档</title>
</head><body>
<input type="radio" value="a" name="sc" />A
<input type="radio" value="b" name="sc" />B<input type="checkbox" value="is" name="msc" disabled="disabled" />choose A Or B
<script type="text/javascript">
jQuery(function($){
$(':radio[name=sc]').click(function(){
$(':checkbox[name=msc]').removeAttr('disabled');
});
});
</script>
</body>
</html>
测试了下,好像不行哦,http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js这个文件我没有哦。。
测试了下,好像不行哦,http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js这个文件我没有哦。。
你的电脑上不了网?这个是google jquery 的cdn地址。不需要你本地有。只要你能上网,浏览器没有禁用javascript脚本
测试了下,好像不行哦,http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js这个文件我没有哦。。
你的电脑上不了网?这个是google jquery 的cdn地址。不需要你本地有。只要你能上网,浏览器没有禁用javascript脚本
能上网啊。。没有禁用js脚本啊,我自己写的都可以用的。。
$(':radio[value=a]').click(function(){
$(':checkbox[name=msc]').removeAttr('disabled');
});
$(':radio[value=b]').click(function(){
$(':checkbox[name=msc]').attr('disabled','disabled');
});
});是不是要这个样子的?按我自己的理解改的代码。