I have 3 checkbox and I want the following behaviour.
- If I click in one checkbox, the others uncheck.
- If I click in a checkbox that is checked, nothing happens.
I have this in jQuery:
('input.checkboxClassName').on('click', function() {
$('input.checkboxClassName').not(this).prop('checked', false);
});
I get #1, but not #2. Any ideas? Thanks a lot.
Aucun commentaire:
Enregistrer un commentaire