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

HTML:<input type="text">文本框不可编辑的方式

时间: 2024-08-09 06:32:48

HTML:<input type="text">文本框不可编辑的方式的相关文章

html5与js关于input[type=&#39;text&#39;]文本框value改变触发事件一些属性的区别oninput,onpropertychange,onchange和文本框的value点击全选状态onclick=&quot;select();&quot;。做购物车页面时会要用到。

关于input[type='text']文本框value改变触发事件一些属性的区别oninput,onpropertychange,onchange和文本框的点击全选状态onclick="select();".做购物车页面时会要用到. input[type='text']文本框value改变触发事件一些属性的区别oninput,onpropertychange,onchange: 1.onchange事件与onpropertychange事件的区别:onchange事件在内容改变(两次

&lt;input type=&quot;text&quot;&gt;文本输人框

type类型: text  文本框 password  口令密码输人框 reset  重置或清除 buttou  命令按钮 checkbox  复选框 radio  单选框 submit  提交 file文件 hidden  隐藏字段 image  图像 color  颜色 email   邮件 date  日期 number  数字 disabled=“disabled”输入控件不可用 readonly=“readonly”只读不能修改

JQuery获取input type=&quot;text&quot;中的值的各种方式

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>JQuery获取文本框的值</title> <meta http-equ

html中去掉文本框(input type=&quot;text&quot;)的边框或只显示下边框

去掉: <input   type="text"   name="textfield"   style="border:0px;">只留下边框: <input type="text" style="BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: solid&

input文本框不可编辑的方法

有时候,我们希望表单中的文本框是只读的,让用户不能修改其中的信息, 如使input text的内容,中国两个字不可以修改有时候,我们希望表单中的文本框是只读的,让用户不能修改其中的信息, 如使<input type="text" name="input1" value="中国"> 的内容,"中国"两个字不可以修改.实现的方式归纳一下,有如下几种. 方法1: onfocus=this.blur() 当鼠标放不上就离开

使input文本框不可编辑的3种方法

一:disabled disabled 属性规定应该禁用 input 元素,被禁用的 input 元素,不可编辑,不可复制,不可选择,不能接收焦点,后台也不会接收到传值.设置后文字的颜色会变成灰色.disabled 属性无法与 <input type="hidden"> 一起使用.示例:<input type="text" disabled="disabled" /> 二:readonly readonly 属性规定输入字

自定义标签&lt;INPUT type = &quot;text&quot;&gt;什么样的写法可以让入力框中的值居右显示

<style type="text/css">input{text-align:right;}</style><form><input type="text" /><form>这样为input标签添加一个简单的css样式就可以了.使用text-align:left/center/right; 其中之一就可以调整文本的位置.

input text 文本框 字符限制

input text中只能输入数字和"-"号<input type='text' onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onblur="this.v();" />

input type =text,按回车键自动提交

1.当form表单中只有一个<input type="text" name='name' />时按回车键将会自动将表单提交 <form id='form1' action='a1.jsp' method='post'> <input type='text' name='name' /> </form> 再添加一个<input type="text"/>按下回车将不会自动提交,但是页面上显示一个不知所云的输入