只有一个RADIO的单选框如何在选中后取消选中

<input type="radio" id="all" value="1" name="executeRadio"  <s:if test="bankApointDateDayCondtion!=null">checked="checked"</s:if> >

var redioCount = 0;
    $(document).ready(function (){

   if($("#all").attr("checked")=="checked") redioCount=1;
        $("input[type='radio']").click(function(){
           if(redioCount == 1){
                $(this).removeAttr("checked");
                redioCount=0;
           }else {
                $(this).attr("checked","checked");
                redioCount=1;
            }
        });

})

原文地址:https://www.cnblogs.com/Lily-L/p/7174413.html