jquery checkbox is checked

52

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 checkbox -

$('.myCheckbox').prop('checked', true);
$('.myCheckbox').prop('checked', false);

Comments

Submit
0 Comments