最新赞助活动温馨提示:自愿赞助服务器费用,学生和没有工作的整站资源免费下载!
头像

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

来源:http://www.erdangjiade.com/topic/132147.html H5程序员 2017-10-31 08:32浏览(58)

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:定义 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 />

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类型的详细介绍的详细内容,更多请关注二当家的素材网其它相关文章!

评论0
头像

友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群

1 2