<input type="text" id="HouseName" value="" align="left"/> <script> //js方式:js對大小寫敏感 document.getElementById("HouseName").readOnly = true; //設置只讀 //readOnly 大小寫敏感 document.getElementById("HouseName").readOnly = false; //取消只讀 //jquery方式: HouseName.attr("readonly","readonly"); //設置爲readonly HouseName.removeAttr("readonly"); //去除元素的readonly屬性 </script>