Answers for "how to get checkbox value in jquery if checked"

63

How to check whether a checkbox is checked in jQuery?

//using plane javascript 
if(document.getElementById('on_or_off_checkbox').checked) {
    //I am checked
} 

//using jQuery
if($('#on_or_off_checkbox').is(':checked')){
    //I am checked
}
Posted by: Guest on July-19-2019
3

jquery in checkbox checked

// Check a checkbox
$(selector).prop('checked', true);
// Un-check a checkbox
$(selector).prop('checked', false);
// Determine if checked or not
isChecked = $(selector).prop('checked');
Posted by: Guest on July-01-2020
3

jquery check if checkbox is checked

if($('#on_or_off_checkbox').is(':checked')){
    //I am checked
}
Posted by: Guest on August-27-2020
1

how get checkbox if checked in jquery

if($("#rule").is(":checked")){
    $("#form").submit();
 }
Posted by: Guest on February-04-2021
0

if checkbox checked jquery value 1

var checked = '0';  if($('#checkbox').prop('checked')){ checked = '1'; }
Posted by: Guest on June-16-2020
0

check if checkbox is checked jquery

var $boxes = $('input[name=thename]:checked');
Posted by: Guest on February-05-2021

Code answers related to "how to get checkbox value in jquery if checked"

Code answers related to "Javascript"

Browse Popular Code Answers by Language