I have a checkbox that needs to remain check once user click on the input box.
Issue: On First Click the checkbox is checked, which works fine. When input is clicked again, the checkbox becomes unchecked.
Output Needed:
I want the checkbox to stay checked as this triggers a change event.
I have searched many examples to find this solution but could not find it.
Any help is appreciated.
Please See Fiddle:
JS:
$('input').click(function() {
$('#x').text(this.checked ? "is checked" : "is not checked");
});
$('.b2').click(function() {
$('.trigger').click();
});
Aucun commentaire:
Enregistrer un commentaire