HTML5的表单中关于所有type类型的详细介绍

互联网 17-5-21
1.button:定义可点击的按钮(通常与 JavaScript 一起使用来启动脚本)。
<input id="" type="button" name="" value="按钮" /><br />  <br />

2.checkbox:定义复选框。<br />

<input id="" type="checkbox" name="" />男<br />  <input id="" type="checkbox" name="" checked="checked" />女<br />  <br />
<input id="" type="cancel" name="" /><br />  <br />
<input id="" type="color" name="" /><br />  <br />

5.date:定义 date 控件(包括年、月、日,不包括时间)。<br />

<input id="" type="date" name="" /><br />  <br />

6.datetime:定义 date 和 time 控件(包括年、月、日、时、分、秒、几分之一秒,基于 UTC 时区)。</p>

<  for  m   action  ="">生日 (日期和时间):<input id="" type="datetime" name="" /> <input id="" type="submit" name="" value="提交" /></form>  <p><br />  <br />

7.datetime-local:定义 date 和 time 控件(包括年、月、日、时、分、秒、几分之一秒,不带时区)。<br />

<input id="" type="datetime-local" name="" /><br />  <br />

8.month:定义 month 和 year 控件(不带时区)。<br />

<input id="" type="month" name="" /><br />  <br />

9.week:定义 week 和 year 控件(不带时区)。<br />

<input id="" type="week" name="" /><br />  <br />
<input id="" type="time" name="" /><br />  <br />

11.email:定义用于 e-mail 地址的字段。</p>

<form action=""></form>  <p>E-mail:<input id="" type="email" name="" /><br />  <br />

12.file:定义文件选择字段和 "浏览..." 按钮,供文件上传。<br />

<input id="" type="file" name="" /><br />  <br />

13.hidden:定义隐藏输入字段。<br />

<input id="" type="hidden" name="" /><br />  <br />

14.image:定义图像作为提交按钮。<br />

<input id="" type="image" name="" /><br />  <br />

15.number:定义用于输入数字的字段。<br />

<input id="" type="number" name="" /><br />  <br />

16.password:定义密码字段(字段中的字符会被遮蔽)。<br />

<input id="" type="password" name="" /><br />  <br />

17.radio:定义单选按钮。<br />

<input id="" type="radio" name="" />男<br />  <input id="" type="radio" name="" checked="checked" />女<br />  <br />

18.range:定义用于精确值不重要的输入数字的控件(比如 slider 控件)。<br />

<input id="" type="range" name="" /><br />  <br />

19.reset:定义重置按钮(重置所有的表单值为默认值)。<br />

<input id="" type="reset" name="" /><br />  <br />

20.search:定义用于输入搜索字符串的文本字段。<br />

<input id="" type="search" name="" /><br />  <br />

21.submit:定义提交按钮。<br />

<input id="" type="submit" name="" value="提交" /><br />  <br />
<input id="" type="tel" name="" /><br />  <br />

23.text:默认。定义一个单行的文本字段(默认宽度为 20 个字符)。<br />

<input id="" type="text" name="" /><br />  <br />

24.url:定义用于输入 URL 的字段。<br />添加你的主页网址:

<input id="" type="url" name="" /></p>

以上就是HTML5的表单中关于所有type类型的详细介绍的详细内容,更多内容请关注技术你好其它相关文章!

来源链接:
免责声明:
1.资讯内容不构成投资建议,投资者应独立决策并自行承担风险
2.本文版权归属原作所有,仅代表作者本人观点,不代表本站的观点或立场
上一篇:php获取远程图片并下载保存到本地的方法分析 下一篇:生日蛋糕的制作方法-不过用的是HTML5+CSS3代码

相关资讯