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浏览器中测试)。

原文地址:https://www.cnblogs.com/blueherb/p/3922557.html