//html<div class="col-lg-3" id="sync"> <div class="checkbox-custom checkbox-default checkbox-inline"> <input type="checkbox" id="syncFlg1" name="syncFlg" value="1" > <label for="syncFlg1">是</label> </div> <div class="checkbox-custom checkbox-default checkbox-inline"> <input type="checkbox" id="syncFlg2" name="syncFlg" value="2" checked> <label for="syncFlg2">否</label> </div> <br></div>//js//checkbox 单选$("#sync :checkbox").click(function(){ $(this).prop("checked",true);//设置当前选中checkbox的状态为checked $(this).parent("div").siblings().children(":checkbox").prop("checked",false);});
联系客服