HTML新增的表单和属性

HTML新增了如下例显示的新表单,具体可参考http://www.w3school.com.cn/html5/att_input_type.asp


<form action="accountController.do" id="account" autocomplete="on" method="post">
Account: <input type="text" name="username" required="required" placeholder="input username!" pattern="[0-9a-zA-Z]{4,9}"/><br>
Password: <input type="password" name="password" placeholder="input account!"/><br>
Email: <input type="email" name="email" autofocus="autofocus" autocomplete="on"/><br>
URL: <input type="url" name="url" /><br>
Birthday: <input type="date" name="birthday" /><br>
Color: <input type="color" name=phone /> <br>
Age: <input type="range" min="18" max="60" step="1"><br>
Attach: <input type="file" multiple="multiple" accept="image/*,.xml,audio/*,video/*" name="fileDemo" id="fileDemo" /><br>
Phone: <input type=tel name=tel ><br>
Search: <input type=search name=search ><br>
Hobby: <input type="text" list="ilist" autocomplete="on">
<datalist id=ilist>
<option value=bskb label="basketball">
<option value=ftb label=football>
</datalist><br>
</form>
<input type="submit" value="submit" form="account"><br>
<input type="reset" value=reset form="account"> <br>


Input表单新增了属性:
[table]
|属性|描述|
|placeholder||
|require||
|pattern|正则表达式校验|
|autofocus| 自动聚焦|
|form|将输入表单与form的Id联系起来,可以将输入表单放在页面的任何位置|
|list|与DATALIST一起使用,提供对选择框的自定义内容|
|autocomplete|此属性是为表单提供自动完成功能。如果该属性为打开状态可很好地自动完成。一般来说,此属性必须启动浏览器的自动完成功能。|
|multiple|用于文件上传控件,设置此属性后,允许上传多个文件。|
|max,min,step|跟数字相关|
|accept|input type=file 可以接受的文件类型,用逗号隔开 |
[/table]

Form表单标签新增加属性
[table]
|novalidate |规定在提交表单时不应该验证 form 或 input 域。|
|autocomplete|规定 form 或 input 域应该拥有自动完成功能。|
[/table]

参考文档:
http://www.w3.org/TR/html5/forms.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值