<strong>方式一:</strong> <br><br>checkbox没有readOnly属性,如果使用disabled=“disabled”属性的话,会让checkbox变成灰色的,用户很反感这种样式可以这样让它保持只读: <br>设置它的onclick="return false" <br><br>js里就是 checkbox.onclick=function(){return false;}; <br><br><strong>方式二:</strong> <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="87574" class="copybut" id="copybut87574" onclick="doCopy('code87574')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code87574"> <br><script src="Demo3.1/jquery-1.4.2.min.js" type="text/javascript"></script> <br><script language="javascript"> <br>$(function(){ <br>$("input[type='checkbox']").click( <br>function(){ <br>this.checked = !this.checked; <br>} <br>); <br>} <br>); <br></script> <br> </div>