input里面check 状态检测

//注意这种方法错误,要用prop
if($("#check_status").attr('checked')) //检测checkbox状态
{
    //checked状态
}else
{
    //不是checked状态
}
//正确
$("#check_all").bind('click',function(){
    if($(this).prop('checked')){
        alert("checked");
    }else{
      alert("no checked");
    }
});

 

 input里面check 状态检测

<div class="item-input wy20-right">
    <label class="label-switch">
        <input type="checkbox" id="check_status">
        <div class="checkbox"></div>
    </label>
</div>                       

 

posted @ 2016-10-28 10:03  天涯alone  阅读(3397)  评论(0编辑  收藏  举报