2014-01-07 80 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

我使用的是表單中的形式更好。這就是問題出現的原因。現在刪除子窗體後,問題就解決了。

相關問題