判断checkbox是否选中

prop() 方法      获取类似属性的值

<input class="parent" type="checkbox" path="path_0" name="power" value="16" onclick="changeChecked($(this))"/>系统参数设置

function changeChecked(t){
var id = t.val();
if(t.prop("checked")){
$("input[name=power][path=path_"+id+"]").prop("checked",true);
console.log($("input[name=power][path=path_"+id+"]"));
}else{
$("input[name=power][path=path_"+id+"]").prop("checked",false);
}
}

posted @ 2015-03-04 16:26  思益  阅读(494)  评论(0编辑  收藏  举报