更新时间:2023-12-05 12:07:28
使用 .prop
而不是 .attr
来影响元素的禁用状态:
Use .prop
instead of .attr
to affect an element's disabled state:
var disableSelection = function(){
$("#elementId").prop("disabled", true);
};
var enableSelection = function(){
$("#elementId").prop("disabled", false);
};
有关详细信息,请参阅.prop() 与 .attr().
For more information, see .prop() vs .attr().