HTML:<input type="text">文本框不可编辑的方式|如何设计禁止编辑的文本框

HTML:<input type="text">文本框不可编辑的方式
1、<input type="text" name="name" value="姓名" disabled />

  该方式显示的文本框内容“姓名”呈灰色显示。

2、<input type="text" name="name" value="姓名" readonly="readonly" />

  文本框正常显示,只是无法获得光标,不能编辑。

3、<input type="text" name="name" value="姓名" onfocus=this.blur() />

  文本框不可编辑,文本不能选择(在opera和360浏览器中测试)。

来源  http://t.zoukankan.com/blueherb-p-3922557.html

2022-7-25

posted @ 2022-07-25 13:38  paoPaoLong_liu  阅读(371)  评论(0)    收藏  举报