一、H5版本中新提出的表单控件
1、电子邮件 <input type="email">
表单提交时,会验证数据是否符号email的规范(有@,并且@后面有内容)
2、搜索类型 <input type="search">
提供了快速清除的功能
3、url类型 <input type="url">
提交时,验证数据是否符合url的规范(http://****)
4、电话号码类型 <input type="tel">
在移动设备中,显示拨号键盘
5、数字类型 <input type="number">
属性:
1)value 默认显示的值
2)max 能接收到的最大值
3)min 能接收到的最小值
4)step 每次调整数字时,步数大小
6、范围类型 <input type="range">
提供一个滑块组件,允许用户选取指定范围的值
属性:
1)value 默认显示的值
2)max 最大值
3)min 最小值
4)step 步长
7、颜色类型 <input type="color">
提供一个颜色拾取器✨
8、日期类型 <input type="date">
9、月份类型 <input type="month">
10、周类型 <input type="week">
11、非H5版本,文件选择框类型 <input type="file">
注意:需要将form的method设置为post,enctype设置为multipart/form-data✨
属性:multiple 无值属性,设置多文件上传(按住ctrl选择)
二、h5常用结构标签
1、<header></header>
2、<nav></nav>
3、<section></section>
4、<aside></aside>
5、<footer></footer>
6、<article></article>
三、js事件
1、event.initEvent
通过DocumentEvent的接口给被创建的事件初始化某些值。
2、event.preventBubble 已废弃 Gecko 24
防止事件冒泡。已弃用,请使用 event.stopPropagation 代替它。
3、event.preventCapture 已废弃 Gecko 24
已弃用,请使用 event.stopPropagation代替它。
4、event.preventDefault
取消事件(如果该事件可取消)。
5、event.stopImmediatePropagation
对这个特定的事件而言,没有其他***被调用。这个事件既不会添加到相同的元素上,也不会添加到以后将要遍历的元素上(例如在捕获阶段)。
6、event.stopPropagation
停止事件冒泡。