Answers for "how to change the state of a checkbox using jquery"

4

change checkbox jquery alert

$(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 by: Guest on May-16-2020
1

how to change checkbox state in jquery

$('[name="SelectedGroup"]').prop('checked', true);
Posted by: Guest on December-17-2020

Code answers related to "how to change the state of a checkbox using jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language