Answers for "how to control of checkbox in jquery"

1

how to check the checkbox in jquery

check all checkbox whit button

// Check #x
$( "#x" ).prop( "checked", true );
 
// Uncheck #x
$( "#x" ).prop( "checked", false );


example

      $('.checkAll').click(function () {
                if($(':checkbox').is(':checked')){
                    $(':checkbox').prop( "checked", false );
                }else{
                    $(':checkbox').prop( "checked", true );
                }
            })
Posted by: Guest on March-27-2021
0

check checkbox by jquery

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

Code answers related to "how to control of checkbox in jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language