<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事件
改成这样貌似可以
$("input[type=radio][name=categoryAttribute.inputType]")
这样得到的是一组radio吧
要么用each,要么用for一个一个绑定