如何判断input 中checkbox 中是否勾选

来源:互联网 发布:c语言中与的符号 编辑:程序博客网 时间:2024/05/18 00:55

按钮<input id="id" type="checkbox" >


<script type="text/javascript">
$(function(){
 
    $("#id").click(function(){
        if($(this).prop("checked")==true){
            console.log("勾选");
        } else{
            console.log("未勾选");
        }
    });
})

</script>

1 0