<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-%201.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></script> </div>