帮忙看看写错了吗?

g1092407 2010-06-09 04:52:32

<input type="radio" name="categoryAttribute.inputType" value='1'/>
<input type="radio" name="categoryAttribute.inputType" value='2'/>
<input type="radio" name="categoryAttribute.inputType" value='3'/>
<input type="radio" name="categoryAttribute.inputType" value='4'/>




$("input[name='categoryAttribute.attributeType']").click(function(){
alert($(this).val());
if($(this).val() == 1 || $(this).val() == 2){
$("input[type='radio'][name='options1'][value='1']").attr("checked","true");
$("input[type='radio'][name='options1'][value='0']").attr("disabled","disabled");
}else
{
$("input[type='radio'][name='options1'][value='0']").attr("checked","true");
$("input[type='radio'][name='options1'][value='0']").attr("disabled","");
}
});




IE7下居然不行,只绑定了最后一个radio的click事件
...全文
107 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hwoarangzk 2010-06-09
  • 打赏
  • 举报
回复
$("input[type=radio][name=categoryAttribute.inputType]")
这样得到的是一组radio吧
要么用each,要么用for一个一个绑定
g1092407 2010-06-09
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 soldierluo 的回复:]

JScript code

改成这样貌似可以
$("input[type=radio][name=categoryAttribute.inputType]")
[/Quote]

试过了 ie7还是不行滴
soldierluo 2010-06-09
  • 打赏
  • 举报
回复

改成这样貌似可以
$("input[type=radio][name=categoryAttribute.inputType]")

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧