使用以下代码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! –