jquery check if checkbox is checked

49

jquery checkbox checked value -

if ($('#check_id').is(":checked"))
{
  // it is checked
}

jquery detect when a checkbox is checked -

$(".checkbox").change(function() {
    if(this.checked) {
        //Do stuff
    }
});

jquery check if checkbox is not checked -

if (!$("#checkboxID").is(":checked")) {
    // do something if the checkbox is NOT checked
}

Comments

Submit
0 Comments