本文操作环境: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); }); } }
推荐:《jquery视频教程》
以上就是jquery checkbox不可选怎么实现的详细内容。
