H5新增的标签总结

摘要:
Type=“color”颜色选择器3:新表单属性required=“required”设置所需项目占位符=“我是默认值”设置默认值,它不会被提交到后台autofocus=“autofocus”autofocuspattern=“d{3}”自定义正则表达式4:自动填写表单陷入困境的人car in trouble泰国5:输出标记

1:便于排版的Form表单

HTML5为了方便排版,可以使form的表单标签脱离form的嵌套。

方法:form指定id,所有的标签标签都添加form= id属性。

例如:

<form action="" method="post" id="register"></form>

<input type="text" name="user" value="" form="register" />

<input type="password" name="pwd" value="" form="register" />

2:form新类型

type = "email" 邮箱(自带格式校验)

type = "url"   网址,必须带协议(自带格式校验)

type = "date"  日期选择器

type = "time" 时间选择器

type = "month" 月份选择器

type = "week" 周选择器

type = "number" 数字选择器

type = "range" 滑动条

max属性

step属性(验证合法性) step="2",例如从0开始,只能选择0-2-4-6-8

type = "search" 搜索框

results="n"谷歌浏览器可用,显示搜索图标。

type = "color" 颜色选择器

3:新增的表单属性

required="required" 设置必填项

placeholder = "我是默认值" 设置默认值,不会提交到后台

autofocus = "autofocus" 自动聚焦

pattern="d{3}" 自定义正则表达式

4:自动填充表单

<input type="text" name="auto" value="" list="movie" />

<datalist id="movie">

<option>人在囧途</option>

<option>车在囧途</option>

<option>泰囧</option>

</datalist>

5:output标签

<form action="" method="post"

oninput="result.value=parseInt(no1.value)+parseInt(no2.value)">

<input type="number" name="no1" value="" />

<input type="number" name="no2" value="" />

<output name="result"></output>

</form>

免责声明:文章转载自《H5新增的标签总结》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇DOM 我们了解它了吗?REST-framework快速构建API--分页下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

HTTP请求中的form data和request payload的区别

国际互联网工程任务组(ietf)对http协议中payload的解释 HTTP messages MAY transfer a payload if not otherwise restricted by the request method or response status code. The payload consists of m...

【转】java异常报错大全

算术异常类:ArithmeticExecption 空指针异常类:NullPointerException 类型强制转换异常:ClassCastException 数组负下标异常:NegativeArrayException 数组下标越界异常:ArrayIndexOutOfBoundsException 违背安全原则异常:SecturityExceptio...

WCF服务

创建了一个WCF服务之后,为了能够方便的使用WCF服务,就需要在客户端远程调用服务器端的WCF服务,使用WCF服务提供的方法并将服务中方法的执行结果呈现给用户,这样保证了服务器的安全性和代码的隐秘性。 18.5.1 在客户端添加WCF服务为了能够方便的在不同的平台,不同的设备上使用执行相应的方法,这些方法不仅不能够暴露服务器地址,同样需要在不同的客户端上能...

跟我一起用Symfony写一个博客网站;

我的微信公众号感兴趣的话可以扫一下, 或者加微信号 whenDreams 第一部分:基础设置,跑起一个页面-首页 第一步: composer create-project symfony/framework-standard-edition 你的项目名; 创建完这个原型,我执行php bin/console server:run,可以跑起来; 那么此刻你...

pyqt 窗口的调用

关于Pyqt窗口调用的格式 正常设计两个ui文件 正常Pyuic转成.py 在唯一的 run.py 函数里这样写即可实现窗口调用 import ... from Timer2 import Ui_Form # Timer2为主ui对于py文件的名字 from TimerSetup import Ui_Form as UISetup # Timer...

spring mvc实现新增用户

spring mvc实现新增用户 1、先在展示页面(查询出来的结果页)添加一个连接<a href="http://t.zoukankan.com/add">添加</a> 2、在后台添加一个添加的方法,点击添加,是跳转到add.jsp页面,刚过去没数据,应该是get方法请求 @RequestMapping(value="/add",...