<div class="codetitle"> <span><a style="CURSOR: pointer" data="29377" class="copybut" id="copybut29377" onclick="doCopy('code29377')"><u>复代码码</u></a></span> 代码如下:</div> <div class="codebody" id="code29377"> <br>$(function(){ <br>$(':checkbox[ name=flag]').each(function(){ <br>$(this).click(function(){ <br>if($(this).attr('checked')){ <br>$( ':checkbox[name=flag]').removeAttr('checked'); <br>$(this).attr('checked','checked') <br>} <br>}); }); <br><br>}); <br><br><input name="flag" id="agree" type="checkbox" selected="checked" value="0"/> 동의 <br><input name="flag" id="reject" type="checkbox" value="1" /> 동의하지 않음 <br><br> </div>