jquery checkbox不可選的實現(xiàn)方法:首先創(chuàng)建一個代碼示例文件;然后通過“$(this).attr("disabled", false);”語句設(shè)置checkbox不可選即可。

jquery如何讓checkbox不可選?
在jquery中,想讓checkbox不可選,就需要禁用checkbox(復(fù)選框),給checkbox添加disabled屬性即可。
示例:
$("input[type=checkbox]").each(function () {
$(this).attr("disabled", false);
});那么禁用的checkbox,如何啟用尼?
JQuery禁用或者啟動checkbox的代碼
function changeCheckboxState(lx){
if(true){
//禁用
$("input[type=checkbox]").each(function(){
$(this).attr("disabled",true);
});
}else{
//啟用
$("input[type=checkbox]").each(function(){
$(this).attr("disabled",false);
});
}
}





