我在 Internet Explorer 中使用 jQuery 在 firefox 和 chrome 中遇到 attr('disabled', 'disabled') 或 prop("disabled", true) 问题,这与预期的一样。有任何想法吗?
我试图在我的 MVC 应用程序的下拉列表中禁用一个项目。它在 IE 中不起作用。
var count = parseInt($("#numCount").val());
if ((isNaN(count) === false) && (count > 500)) {
$("#ReportType option[value='Report']").attr("disabled", "disabled");
$("#ReportType option[value='Report']").prop("disabled", true);
}