HTML5表单
新的 input 类型(type)
email 在提交表单时,会自动验证 email 域的值
url 在提交表单时,会自动验证 url 域的值
number 数值的输入域,还可通过min和max属性限制数字范围,通过step属性设置数字间隔,value设置默认值
range 包含一定范围内数字值的输入域,显示为滑动条.可选属性:min/max/step/value
date 选取日、月、年
month - 选取月、年
week - 选取周和年
time - 选取时间(小时和分钟)
datetime - 选取时间、日、月、年(UTC 时间)
datetime-local - 选取时间、日、月、年(本地时间)
search 用于搜索域
新的 表单元素
datalist 规定输入域的选项列表
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <input type="url" list="url_list" /> <datalist id="url_list"> <option value="Baidu">http://www.baidu.com</option> <option value="Taobao">http://www.taobao.com</option> </datalist> </body> </html>

keygen 是密钥对生成器(key-pair generator)。当提交表单时,会生成两个键,一个是私钥,一个公钥。
私钥(private key)存储于客户端,公钥(public key)则被发送到服务器。公钥可用于之后验证用户的客户端证书(client certificate)。
output 用于不同类型的输出,比如计算或脚本输出.
新的 表单属性
新的 form属性
autocomplete 规定 form 或 input 域应该拥有自动完成功能
novalidate 规定在提交表单时不应该验证 form 或 input 域
新的 input属性
autocomplete 规定 form 或 input 域应该拥有自动完成功能
autofocus 在页面加载时,域自动地获得焦点
height和width 规定用于 image 类型的 input 标签的图像高度和宽度
list 规定输入域的 datalist
min/max/step 最小值/最大值/数字间隔
multiple 规定输入域中可选择多个值
pattern(regexp) 规定用于验证 input 域的模式
placeholder 提供一种提示(hint),描述输入域所期待的值
required 规定必须在提交之前填写输入域(不能为空)
表单 重写属性
formaction 重写表单的 action 属性
formenctype 重写表单的 enctype 属性
formmethod 重写表单的 method 属性
formnovalidate 重写表单的 novalidate 属性
formtarget 重写表单的 target 属性
浙公网安备 33010602011771号