HTML中让表单input等文本框为只读不可编辑的方法

时间:2017-01-19 14:29:59   收藏:0   阅读:214
 1 方法1: onfocus=this.blur() 当鼠标放上就离开焦点
 2 <input type="text" name="input1" value="中国" onfocus=this.blur()> 
 3 
 4 方法2:readonly 
 5 <input type="text" name="input1" value="中国" readonly> 
 6 <input type="text" name="input1" value="中国" readonly="true"> 
 7 
 8 方法3: disabled 
 9 <input type="text" name="input1" value="中国" disabled="true">
10 来源: http://www.jb51.net/web/62128.html

 

原文:http://www.cnblogs.com/ghfjj/p/6306204.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!