Sometimes we need to check/unchecked checkbox based on some condition. We can do this easily by using "checked" attribute of a button.
Example:
<input type="checkbox" id="addressCheckBox" class="form-control">
<label>I confirm this is my address</label>
To unchecked the checkbox write the below line:
$('#addressCheckBox').prop('checked', false);
To check again after unchecked the checkbox:
$('#addressCheckBox').prop('checked', true);
Hope this will help you :)
0 Comment(s)