1.开启disabled,是input不可以编辑
$("#id").attr("disabled","disabled");
2.关闭disabled
$("#id").removeAttr("disabled");
普通js中是这样写的,document.getElementById("id").disabled = false;
错误写法:$("#id").attr("disabled","false");
时间: 2025-01-02 13:30:41
1.开启disabled,是input不可以编辑
$("#id").attr("disabled","disabled");
2.关闭disabled
$("#id").removeAttr("disabled");
普通js中是这样写的,document.getElementById("id").disabled = false;
错误写法:$("#id").attr("disabled","false");