本文操作环境:Windows7系统、jquery1.2.6、Dell G3电脑。
jquery如何让checkbox不可选?
在jquery中,想让checkbox不可选,就需要禁用checkbox(复选框),给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);
});
}
}
推荐:《》
藏色散人 
![[爱了]](/js/img/d1.gif)
![[尴尬]](/js/img/d16.gif)