首页 > Web开发 > 详细

HTML中Text设为不可编辑,不可用

时间:2015-01-15 01:52:27      阅读:220      评论:0      收藏:0      [点我收藏+]

1.readonly = "true"

<input type="text"  readonly = "true"/>

 

2.disabled = "true"

<input type="text"  disabled = "true"/>


3.当focus触发时,立刻blur,使它无法获得焦点。

<input type="text" onfocus="this.blur()"  readonly="true"/>


readonly/disabled都可以不跟参数,默认都是不可编辑;disabled="true"文本不可提交,readonly="true"可被提交。


本文出自 “Shows technology” 博客,请务必保留此出处http://wangzhijun.blog.51cto.com/9660708/1604078

HTML中Text设为不可编辑,不可用

原文:http://wangzhijun.blog.51cto.com/9660708/1604078

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!