使用jQuery设置disabled属性与移除disabled属性

//两种方法设置disabled属性
$('#areaSelect').attr("disabled",true);
$('#areaSelect').attr("disabled","disabled");
 
//三种方法移除disabled属性
$('#areaSelect').attr("disabled",false);
$('#areaSelect').removeAttr("disabled");
$('#areaSelect').attr("disabled","");
 
js
function disableElement(element,val){
 
document.getElementById(element).disabled=val;
}
 
获取s:textfield,并设置其disabled属性:
 
functiondisableTextfieldofAccountDiv(element,val) {
 
$(element).find(":textfield").attr('disabled',val);
}

转载于:https://www.cnblogs.com/quitpoison/p/8808708.html

你可能感兴趣的:(javascript)