2014-01-07 81 views

回答

1

尝试使用jQuery removeAttr,而不是删除选中的属性:

$('#send_order_form input[type="radio":checked]').each(function(){ $(this).removeAttr("checked"); }); 
+0

没有变化,我仍然看到按钮被点击。我再说一遍,在检查元素时,检查属性实际上被删除。 –

+0

@SamarRizvi请看看这个http://jsfiddle.net/CdLwg/1/ –

0

试试这个:

$('#send_order_form input[type="radio":checked]').each(function(){ 
    $(this).prop('checked', false); 
}); 
+0

已经尝试过了,没有效果。 –

+0

尝试将'false'参数更改为空字符串''''。 –

+0

哦,我正在使用错误的参数。看到我更新的答案 - 使用'prop()',而不是'attr()'。 –

0

你在你选择的检查输入有微小误差。试试这个:

$('#send_order_form input[type="radio"]:checked').each(function(){ 
     this.checked = false; 
}); 

甚至

$('#send_order_form input[type="radio"]:checked').attr('checked', false); 
0

我使用的是表单中的形式更好。这就是问题出现的原因。现在删除子窗体后,问题就解决了。

相关问题