<input type="text" name="up" size="10" value="test" readonly>

解决方案 »

  1.   

    文本框只读性选择:<input type=checkbox onclick="document.all.txt.readOnly=this.checked">
    <input type=text name=txt>
      

  2.   

    meizz(梅花雨)的例子够精简了。
      

  3.   

    哈哈,决定自己改一下,不知道有趣否:
    <input type=text name=txt onkeyup="this.readOnly=!this.readOnly;"/>
      

  4.   

    To: Reve(仨仁仕) 你的代码让我晕 @_@ ,逗!
      

  5.   

    haha
    没想到要用鼠标点到外边或失去focusreadOnly才可以生效
    再改:
    <input type=text name=txt1 onkeyup="this.readOnly=!this.readOnly;txt2.focus();txt2.value=txt2.value;">
    <input type=text name=txt2 onkeyup="this.readOnly=!this.readOnly;txt1.focus();txt1.value=txt1.value;">
    hehe
      

  6.   

    <HTML>
    <HEAD>
    <TITLE></TITLE>
    </HEAD>
    <BODY onload="txt.disabled=true">
    <input type=text name=txt>
    </BODY>
    <HTML>这个不页一样?