<progress> 和 <meter> 元素是表单元素吗?
Are <progress> and <meter> elements are form elements?
Mozilla 列出了所有 html 元素 here 和 <progess>
& <meter>
元素在那里分组为 <form>
元素。我想问一下是不是<form>
元素?我的意思是我应该在 <form>
元素中使用它们吗?
根据 Mozilla 和官方 W3C 规范文档,<progress>
W3C and <meter>
W3C are valid within any parent node that accepts phrasing content.
更直接地回答:不需要将它们放在 <form>
元素中。您是否应该 使用它的问题完全取决于您的设计以及您这样做是否有意义。
只有 <form>
元素是表单元素。
HTML 规范列出了 form-associated elements 个数。此列表不包括 <progress>
或 <meter>
.
然而,同一部分确实将 <progress>
和 <meter>
列为 可标记元素 ,因此它们可以具有与之关联的 <label>
像大多数表单控件一样。
<progress>
element and <meter>
element 可以同时使用 "Where phrasing content is expected",因此它们可以在表单内部或外部使用。
Mozilla 列出了所有 html 元素 here 和 <progess>
& <meter>
元素在那里分组为 <form>
元素。我想问一下是不是<form>
元素?我的意思是我应该在 <form>
元素中使用它们吗?
根据 Mozilla 和官方 W3C 规范文档,<progress>
W3C and <meter>
W3C are valid within any parent node that accepts phrasing content.
更直接地回答:不需要将它们放在 <form>
元素中。您是否应该 使用它的问题完全取决于您的设计以及您这样做是否有意义。
只有 <form>
元素是表单元素。
HTML 规范列出了 form-associated elements 个数。此列表不包括 <progress>
或 <meter>
.
然而,同一部分确实将 <progress>
和 <meter>
列为 可标记元素 ,因此它们可以具有与之关联的 <label>
像大多数表单控件一样。
<progress>
element and <meter>
element 可以同时使用 "Where phrasing content is expected",因此它们可以在表单内部或外部使用。