1级标题代表标签
2级标题代表属性
input
form
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 这个参数了