Created
March 25, 2025 12:35
-
-
Save stiig/aba27b107ed646a687f8aecc2ce606a1 to your computer and use it in GitHub Desktop.
Solution for making checkboxes behave like radio buttons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.checkbox_like_radio').on('click', 'input[type="checkbox"]', function() { | |
$(this) | |
.closest('.checkbox_like_radio') | |
.find('input[type="checkbox"]') | |
.not(this) | |
.prop('checked', false); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment