Skip to content

Instantly share code, notes, and snippets.

Created November 1, 2012 00:08
What would you like to do?
uncheckable radio buttons
* Uncheckable radio buttons o_O
* usage:
* <input type="radio" name="something" class="uncheckable" />
$('input[type=radio].uncheckable').on('click', function(event){
var $this = $(this);
var was_checked = $'checked');
$('input[name='+$this.prop('name')+']').data('checked', false);
$'checked', !was_checked).prop('checked', !was_checked);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment