Answers for "jquery checkbox event listener"

9

check checkbox by jquery

$('.myCheckbox').prop('checked', true);
$('.myCheckbox').prop('checked', false);
Posted by: Guest on May-19-2020
4

events on checkbox in jquery

$(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
0

checkbox on click jquery

$(document).ready(function() {
  //set initial state.
  $('#textbox1').val($(this).is(':checked'));

  $('#checkbox1').change(function() {
    $('#textbox1').val($(this).is(':checked'));
  });

  $('#checkbox1').click(function() {
    if (!$(this).is(':checked')) {
      return confirm("Are you sure?");
    }
  });
});
Posted by: Guest on September-14-2020
0

check checkbox by jquery

$('.myCheckbox')[0].checked = true;
$('.myCheckbox')[0].checked = false;
Posted by: Guest on September-04-2020

Code answers related to "jquery checkbox event listener"

Code answers related to "Javascript"

Browse Popular Code Answers by Language