HTML5输入元素包含一个'form'属性,它可以包含一个或多个以空格分隔的表单id.请参阅下面的简化示例,其中form1和form2共享一个输入元素.
<form id="form1" method="post">
<input type="submit">
</form>
<form id="form2" method="post">
<input type="submit">
</form>
<input type="text" form="form1 form2">
Run Code Online (Sandbox Code Playgroud)
至少,它应该如何工作:
http://swatelier.info/at/forms/HTML5attrib.asp
http://www.w3schools.com/tags/att_input_form.asp
在Chrome 28中,我看到添加第二个表单ID会隐藏两个表单中的输入元素.哪些现代浏览器(如果有)支持此功能?
w3schools指定:"定义和用法:form属性指定元素所属的一个或多个表单." 在http://www.w3schools.com/tags/att_input_form.asp
和提示:要引用多个表单,请使用以空格分隔的表单ID 列表." 在http://www.w3schools.com/html/html5_form_attributes.asp
而developer.mozilla .org声明:"输入只能与一个表单相关联." 在https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input
谁在这?