您的位置:首页 > Web前端 > HTML5

[html5]记一些html5的东西

2016-03-16 11:56 453 查看
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 这个参数了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: