input不可编辑input不可编辑

如题所述

input不可编辑,input不可编辑很多人还不知道,现在让我们一起来看看吧!
1、在HTML中制作表单input不可编辑的方法。有时,我们希望表单中的文本框是只读的,这样用户就不能修改其中的信息。比如输入type=' text ' name=' input 1 ' value=' China ',那么' China '这个词就不能修改。总而言之,有几种方法可以实现input不可编辑的方法
2、input不可编辑,方法1:focus=this.blur()在鼠标放不起来的时候离开焦点。
3、type=' text ' name=' input 1 ' value=' China ' onfocus=this . blur()
4、input不可编辑,方法2:只读
5、type=' text ' name=' input 1 ' value=' China ' readonly
6、type=' text ' name=' input 1 ' value=' China ' readonly=' true '
7、方法3:已禁用
8、type=' text ' name=' input 1 ' value=' China ' disabled=' true '
9、3360的完整示例
10、input name=' ly _ QQ ' type=' text ' tabindex=' 2 ' on mouseover=' this . class name=' input _ 1 ' ' on mouseout=' this . class name=' input _ 2 ' ' value=' 123456789 ' disabled=' true ' readOnly=' true '/
11、Disabled='true '此处的文本将变成灰色,input不可编辑
12、ReadOnly='true '文本不改变颜色,不能编辑。
13、Css屏蔽输入:输入样式=“禁用输入法模式3360”
14、input不可编辑有两个方法:第一,disabled='disabled '。在这个定义之后,禁用的输入元素既不可用也不可点击。第二:readonly='readonly '只读字段不能修改。但是,用户仍然可以使用tab键切换到该字段,并选择或复制其文本。
本文讲解到此结束,希望对大家有所帮助。
温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

大家正在搜

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网