码迷,mamicode.com
首页 > Web开发 > 详细

HTML5的表单所有type类型

时间:2017-05-16 19:16:29      阅读:223      评论:0      收藏:0      [点我收藏+]

标签:span   search   orm   for   复选框   搜索字符串   数字   input   搜索   

1.button:定义可点击的按钮(通常与 JavaScript 一起使用来启动脚本)。<br />
<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 />

3.cancel:取消按钮,用于取消submit的提交。<br />
<input id="" type="cancel" name="" /><br />
<br />

4.color:定义拾色器。<br />
<input id="" type="color" name="" /><br />
<br />


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


6.datetime:定义 datetime 控件(包括年、月、日、时、分、秒、几分之一秒,基于 UTC 时区)。</p>
<form action="">生日 (日期和时间):<input id="" type="datetime" name="" /> <input id="" type="submit" name="" value="提交" /></form>
<p><br />
<br />


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

10.time:定义用于输入时间的控件(不带时区)。<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 />


22.tel:定义用于输入电话号码的字段。<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类型

标签:span   search   orm   for   复选框   搜索字符串   数字   input   搜索   

原文地址:http://www.cnblogs.com/wuheng1991/p/6863100.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!