<div class="controls" style="line-height: 40px;">
<#list fsbxlxList as obj>
<label class="checkbox">
<input type="radio" value="${obj.id}" name="fslxchecks" onclick="sfxz()"
<#if entity?exists && entity.bxlxid?exists>
<#list entity.bxlxid.split(",") as bxlxid>
<#if bxlxid?exists && bxlxid=obj.id>checked</#if>
</#list>
</#if> />
${obj.name}
</label>
</#list>
</div>
废话少说,直接上代码
function sfxz(){
var old = null;
$("input[name='单选框的name的值']").each(function(){
if(this.checked){
old = this;
}
this.onclick = function(){
if(this == old){
this.checked = false;
old = null;
} else{
old = this;
}
}
});
}