单选按钮选中、取消
<input type="radio" name="xxx">
$(function() {
$(‘input:radio’).click(function () {
//alert(this.checked);
var domName = $(this).attr('name');
var $radio = $(this);
// if this was previously checked
if ($radio.data('waschecked') == true) {
console.log($radio.data('waschecked') == true);
$radio.prop('checked', false);
//$("input:radio[name='radio" + domName + "']").data('waschecked',false);
$radio.data('waschecked', false);
} else {
console.log($radio.data('waschecked') == true);
$radio.prop('checked', true);
//$("input:radio[name='radio" + domName + "']").data('waschecked',true);
$radio.data('waschecked', true);
}
});
});