按钮内的禁用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);