value属性

value属性指定输入字段的初始值:

<form>
名字:<br>
<input type="text" name="yourname" value="Jim"><br>
姓氏:<br>
<input type="text" name="homename" value="Green">
</form>

readonly属性

readonly属性指定输入字段是只读的(不能更改):

<form action="/jc_script/urlencode.php" target="_blank">
名字:<br>
<input type="text" name="yourname" value="Jim"><br>
姓氏:<br>
<input type="text" name="homename" value="Green" readonly>
<input type="submit" value="提交">
</form>

disabled属性

disabled属性指定禁用输入字段。禁用的输入字段不可用且不可单击,并且在提交表单时不会发送其值:

<form action="/jc_script/urlencode.php" target="_blank">
名字:<br>
<input type="text" name="yourname" value="Jim"><br>
姓氏:<br>
<input type="text" name="homename" value="Green" disabled>
<input type="submit" value="提交">
</form>

size属性

size属性指定输入字段的大小(以字符为单位):

<form action="/jc_script/urlencode.php" target="_blank">
名字:<br>
<input type="text" name="yourname" value="Jim" size="40"><br>
姓氏:<br>
<input type="text" name="homename" value="Green">
<input type="submit" value="提交">
</form>

  

HTML5添加的属性

下表列出了HTML5添加的一些新属性:

属性名称 所属元素
autocomplete <form>,<input>
autofocus <input>
form <input>
formaction <input>
formenctype <input>
formmethod <input>
formnovalidate <input>
formtarget <input>
height <input>
width <input>
list <input>
min <input>
max <input>
multiple <input>
pattern (regexp) <input>
placeholder <input>
required <input>
step <input>
novalidate <form>

更多的HTML5 input 属性介绍

HTML input属性详谈的更多相关文章

  1. JQuery设置input属性(disabled、enabled)

    document.getElementById("removeButton").disabled = false; //普通Js写法 $("#removeButton&q ...

  2. html5 input属性

    今天才接确html5 +css3 实在是太赞了.  下面我就来介绍一下今天我用到的 input 属性. html5 代码如下: <input type="text" plac ...

  3. HTML Input属性

    HTML Input 属性 value 属性 value 属性规定输入字段的初始值: readonly 属性 readonly 属性规定输入字段为只读(不能修改): readonly 属性不需要值.它 ...

  4. 修改input属性placeholder的样式

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. input属性disabled和readonly的区别

    两种属性的写法如下: 1.<input type="text" name="name" value="xxx" disabled=&q ...

  6. HTML 表单元素、 输入类型、Input 属性

    <input> 元素 最重要的表单元素是 <input> 元素. <input> 元素根据不同的 type 属性,可以变化为多种形态. 注释:下一章讲解所有 HTM ...

  7. HTML5 添加新的标签 input属性

    <!-- 新增 有语意标签 --> <nav></nav> <!-- 导航标签 --> <seclion></seclion> ...

  8. input 属性radio中设置checked 不生效

    同一个页面中有许多地方都用到了单选按钮并设置了默认选中 , 结果在运行的时候发现单选按钮没有被默认选中 由于是复制然后修改个别属性 ,然后直接使用的 , 所以name值忘记修改了 , 单选框是根据na ...

  9. input属性type为file打开文件资源管理器时,如何限制多次选取或只能一次选取的行为

    1.input标签没有设置multiple属性,文件资源管理器默认一次选取 <!doctype html> <html lang="en"> <hea ...

随机推荐

  1. contentOffset、contentSize和contentInset

    1.UIScrollView@property(nonatomic)CGPoint contentOffset;这个属性用来表示UIScrollView滚动的位置 @property(nonatomi ...

  2. curl smtp libcurl 邮件功能使用

    /* * For an SMTP example using the multi interface please see smtp-multi.c. */ /* The libcurl option ...

  3. IntelliJ IDEA UML插件

    在IntelliJ IDEA Ultimate 版本中自带了一个UML插件:UMLSupport 查看了Community版本和AndroidStudio 发现没有这个插件. 要使用这个插件导出需要的 ...

  4. 我认为现代IDE编辑器应该具有的几个特性和Visual studio 2010增强

    工作中要使用 VS 2010, 有好多年没有使用Visual studio 了, 试了一小会, 发现VS 2010 缺少不少现代IDE应有的特性, 我认为重要的是下面几个特性, VS2010 已经是1 ...

  5. Scala开发问题汇总

    1.JDK版本问题 Error:java.lang.VerifyError: Uninitialized Exception Details: Location: scala/collection/i ...

  6. iPad替代midi键盘

    下载安装rtpMIDI (网络MIDI驱动程序) 打开rtpMIDI,在“My session”那里按下+,就会自动显示你的电脑的名字 检查Bonjour服务正常运行,iPad与pc网络正常连接 iP ...

  7. CF358D Dima and Hares

    CF358D Dima and Hares 洛谷评测传送门 题目描述 Dima liked the present he got from Inna very much. He liked the p ...

  8. Semantic 3D

    Semantic 3D 这个数据级别的训练集有一个小BUG,是这个neugasse_station1_xyz_intensity_rgb.7z, 解压之后的名字是station1_xyz_intens ...

  9. angular跳转和传参

    使用routerLink跳转 <a routerLink=["/exampledetail",id]></a> <a routerLink=[&quo ...

  10. InvalidProgramException

    InvalidProgramException 这tmd是个什么错,我现在都想不起这个exception是怎么触发的了. 后来google了一下,发现是.net 2.0的编译器的bug,和内存或堆栈使 ...