常见HTML5新增表单特性演示
分享一段代码实例,它简单演示了HTML5新增的一些常用表单新特性。
这些新特性能够在一定程度上提高我们的开发效率。
代码实例如下:
|
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
<!doctype html>
<
html
>
<
head
>
<
meta
charset
=
"utf-8"
>
<
title
>蚂蚁部落</
title
>
</
head
>
<
body
>
<
form
action
=
""
method
=
"get"
id
=
"foo"
>
邮件:<
input
type
=
"email"
placeholder
=
"请输入正确的邮箱地址"
/>
<
br
/>
网址:<
input
type
=
"url"
/>
<
br
/>
日期:<
input
type
=
"date"
/>
<
br
/>
月份:<
input
type
=
"month"
/>
<
br
/>
周: <
input
type
=
"week"
/>
<
br
/>
时间:<
input
type
=
"datetime"
/>
<
br
/>
数字:<
input
type
=
"number"
/>
<
br
/>
滑动:<
input
type
=
"range"
min
=
"0"
max
=
"100"
step
=
"1"
>
<
br
/>
搜素:<
input
type
=
"search"
results
=
"n"
value
=
"搜索"
>
<
br
/>
颜色:<
input
type
=
"color"
/>
<
br
/>
正则表达式:<
input
type
=
"text"
pattern
=
"[789]+"
required />
<
br
/>
<
datalist
id
=
"mydata"
>
<
option
label
=
"top1"
value
=
"asp.net"
></
option
>
<
option
label
=
"top2"
value
=
"C#"
></
option
>
<
option
label
=
"top3"
value
=
"ado"
></
option
>
<
option
label
=
"top4"
value
=
"server"
></
option
>
<
option
label
=
"top5"
value
=
"ajax"
></
option
>
</
datalist
>
<
input
type
=
"submit"
/>
</
form
>
</
body
>
</
html
>
|
原文发布时间为:2017-3-23
本文作者:admin
本文来自云栖社区合作伙伴“蚂蚁部落”,了解相关信息可以关注蚂蚁部落
原文链接:常见HTML5新增表单特性演示