jquery中如何判断checkbox是否选中

jquery代码:

<script>
$(document).ready(function() {
                $('#checkbox-id').click(function() {
                    if($('#checkbox-id').is(':checked') == true) {
                        alert('选中');
                    }

                });

            });

</script>

 html代码:

<div class="div-radio">
       <input type="checkbox" id="checkbox-id" />Between Dates
</div>

 

posted @ 2017-08-17 14:10  Ocean丶  阅读(791)  评论(0编辑  收藏  举报