1.开启disabled,是input不可以编辑
$("#id").attr("disabled","disabled");
2.关闭disabled
$("#id").removeAttr("disabled");
普通js中是这样写的,document.getElementById("id").disabled = false;
错误写法:$("#id").attr("disabled","false");
时间: 2024-10-24 22:03:25
1.开启disabled,是input不可以编辑
$("#id").attr("disabled","disabled");
2.关闭disabled
$("#id").removeAttr("disabled");
普通js中是这样写的,document.getElementById("id").disabled = false;
错误写法:$("#id").attr("disabled","false");