html中讓input標簽只讀不可編輯的方法


html中讓input標簽只讀不可編輯的方法

方法1:onfocus=this.blur()

<input type="text" name="input1" value="曉藝" onfocus=this.blur() >

方法2:readonly

<input type="text" name="input1" value="曉藝" readonly >
<input type="text" name="input1" value="曉藝" readonly="true" >

方法3:disabled

<input type="text" name="input1" value="曉藝" disabled >

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM