[html5]记一些html5的东西

来源:互联网 发布:seo关键词优化怎么做 编辑:程序博客网 时间:2024/06/04 19:32

1级标题代表标签
2级标题代表属性

input

form

这里是MDN上面的解释

The form element that the input element is associated with (its form owner). The value of the attribute must be an id of a element in the same document. If this attribute is not specified, this element must be a descendant of a element. This attribute enables you to place elements anywhere within a document, not just as descendants of their form elements.

一般input标签都是放在form标签里面去提交的,但现在,允许将input标签放在任何地方,只要给input设置form属性,值为form标签的id值。

例如这样:

<form id="form" action="/">    <button>submit</button></form><input form="form" type="hidden" name="id" value="001">

这样点击submit按钮后,就会自动带上 id=001 这个参数了

0 0
原创粉丝点击