禁用div工作在chrome



按钮内的禁用div在chrome中工作。在Firefox中,它不起作用。

$(".div_class").attr('disabled', 'disabled');
有人会有经验的。请提出你的建议。

感谢

你好,这是这个问题的解

$(".div_class).find('input,textarea,select,button').attr('disabled', 'disabled');

.prop( propertyName, value )代替.attr( attributeName, value )

同时禁用button而不是.div_class:

$(".div_class button").prop("disabled", true);

根据文档,禁用div没有任何意义,因为div element没有被称为disabled的属性或属性。忘记div禁用button

$('#buttonselector').prop("disabled", true);

最新更新