HTML的input--元素类型
input元素类型
- ①邮箱
<input type="email" name="em">
验证,必须有@,并且@前后必须有字符
- ②搜索类型
<input type="search" name="sear">
提供了一个快速清除的小叉叉
结果
- ③url类型
<input type="url" name="url">
验证必须有http:并且后面必须有字符
- ④电话号码类型
<input type="tel" name="tel">
在移动端,获取焦点后,弹出虚拟键盘
- ⑤数字类型
<input type="number" name="num" max="20" min="10" step="3">
max="20" 最大值
min="10" 最小值
step="3" 步长
结果
- ⑥范围类型
<input type="range" name="range" max="20" min="10" step="3">
提供了一个数字范围的滑块
结果
- ⑦颜色类型
<input type="color" name="color">
结果
- ⑧日期类型
<input type="date" name="date">
结果
- ⑨月份类型
<input type="month">
结果
- ⑩星期类型
<input type="week">
结果