//js的方式
//动态修改元素disabled属性
function disableTest(element,val){
document.getElementById(element).disabled=val;
}
document.getElementById("uid").disabled="";//启用
document.getElementById("uid").disabled="disabled";//禁用
//JQuery的方式
//两种设置disabled属性
$('#uid').attr("disabled",true);
$('#uid').attr("disabled","disabled");
//三种移除disabled属性
$('#uid').attr("disabled",false);
$('#uid').removeAttr("disabled");
$('#uid').attr("disabled","");
functiondisableTextfieldofAccountDiv(element,val) {
$(element).find(":textfield").attr('disabled',val);
}
标签:属性,attr,val,js,disabled,移除,element,uid
From: https://www.cnblogs.com/nuomibaibai/p/17616335.html