首页 > 编程知识 正文

html5中新增的表单元素,HTML5新增的内容有哪些

时间:2023-05-05 17:38:09 阅读:284704 作者:2619

HTML5中新增的元素有哪些

1.新增的结构元素

语义化的标签 <article></article> 文章 <section></section> 独立的区域 <header></header> 头部 <footer></footer> 尾部 <aside></aside> 侧边栏广告 <address></address> 地址 <nav></nav> 导航 <figure> 有标题的独立区域 <figcaption></figcaption> <div></div> </figure> <details open> <summary>标题</summary> <div></div> </details>

2.新增的表单控件

<progress></progress> <meter></meter> <output></output> <datalist></datalist>

3.H5中input的type属性的扩展
type=“number” 数值框
type=“range” 滑块
type=“search” 搜索框
type=“color” 颜色框,#ffffff
type=“tel” 电话框
type=“url” 网址url框,自带表单验证,http:// https://
type=“email” 邮箱框,自带验证,XXX@XXX
type=“date” 日期,2020-09-09
type=“datetime-local” 日期和时间 2020-09-09T09:09:09
type=“time” 时间 09:09:09
type=“week” 年周 2020-W07
type=“month” 年月 2020-09
4.新增属性
form属性,值为一个form标签的id值
formaction属性,指定提交按钮提交数据的地址
formenctype属性,指定表单提交的编码格式
formmethod属性,指定表单提交的方式
formnovalidate属性,指定表单是否验证,布尔属性,写上就代表不验证
formtarget属性,指定响应打开的方式
autofocus 自动聚焦
required 必填项
pattern 正则表达式匹配验证
list 绑定datalist,数据列表
placeholder 占位符
min 最小值
max 最大值
5.H5中的媒体元素
audio
video
controls 控制条
loop 循环播放
muted 静音播放
autoplay 自动播放

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。