Created
November 25, 2017 09:17
-
-
Save abhishek-9ithub/183632f90ee6a4023463f1bda2cb8fd2 to your computer and use it in GitHub Desktop.
checkbox check one at a time
This file contains 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
$(function(){ | |
$(':checkbox').on('change',function(){ | |
var th = $(this), name = th.prop('name'); | |
if(th.is(':checked')){ | |
$(':checkbox[name="' + name + '"]').not($(this)).prop('checked',false); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment