jquerycheckbox事件

https://stackoverflow.com/questions/7031226/jquery-checkbox-change-and-click-event

$(document).ready(function() {
    //set initial state.
    $('#textbox1').val($(this).is(':checked'));

    $('#checkbox1').change(function() {
        if($(this).is(":checked")) {
            var returnVal = confirm("Are you sure?");
            $(this).attr("checked", returnVal);
        }
        $('#textbox1').val($(this).is(':checked'));        
    });
});

  

posted @ 2017-08-10 18:38  每天一点积累  阅读(434)  评论(0编辑  收藏  举报