1. 程式人生 > >jquery 設定、取消disabled、checked 等屬性

jquery 設定、取消disabled、checked 等屬性

//兩種方法設定disabled屬性
$('#areaSelect').attr("disabled",true);
$('#areaSelect').attr("disabled","disabled");

//三種方法移除disabled屬性
$('#areaSelect').attr("disabled",false);
$('#areaSelect').removeAttr("disabled");
$('#areaSelect').attr("disabled","");