使用以下代碼JQuery的IE11單選按鈕選擇
$(".submitButton").click(function(event){
if ($(this).hasClass("disabled")){
event.preventDefault();
return false;
}
if (!$(this).hasClass("disabled")){
$('.invoice-form').find(':input').prop("disabled",false);
$(".invoiceDate").prop("disabled",true);
//event.preventDefault();
//return false;
}
});
在IE11,提交表單時,所有的元素都被使能,除單選按鈕。
對此有何意見?我們需要重新啓用單選按鈕,以便設置適當的值。它在非IE瀏覽器中按預期運行。
嘗試寫下如下($(this).hasClass(「disabled」){your code} else {}而不是if(!$(this)){} –
讓我們看看HTML! –