Click here to Skip to main content
16,004,761 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How To Check Checkbox Check UnCheck In Jquery ,plese help me
Posted

Use the new .prop() function:

$('.myCheckbox').prop('checked', true);
$('.myCheckbox').prop('checked', false);
 
Share this answer
 
$('#submitBtn').click(function () {
                $('input:checkbox:checked').each(function (i) { 
//what you want to do with checked boxes// 
                 }); 
});
 
Share this answer
 
Working Solution:
Add Jquery library reference to use below code

Java
var isChecked = $('#chkSelect').attr('checked')?true:false;
 
Share this answer
 
v2
Working Solution:

The given statement work with jquery

var isChecked = $('input[type="checkbox"]').is(':checked');
 
Share this answer
 
$('#Checkbox1').attr('checked', true); // Checks it
$('#Checkbox2').attr('checked', false); // Unchecks it
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900