checkbox check using jquery code example
Example 1: Setting “checked” for a checkbox with jQuery
$('.myCheckbox').prop('checked', true);
$('.myCheckbox').prop('checked', false);
Example 2: How to check whether a checkbox is checked in jQuery?
if(document.getElementById('on_or_off_checkbox').checked) {
}
if($('#on_or_off_checkbox').is(':checked')){
}
Example 3: checkbox is checked jquery
$("#out_of_stock_toggle").click(function(){
if($(this).is(':checked')){
$(".oos").fadeIn();
}else{
$(".oos").fadeOut();
}
});
Example 4: jquery get checkbox condition
if ($('input.checkbox_check').is(':checked')) {
Example 5: checkbox jquery checked
var isExpanded = $(this).attr('checked') == "checked";