是<输入>没有< form>? [英] Is <input> well formed without a <form>?
问题描述
在< form>
?中< input> p>
有一个标记页面中某些字段的过程,只是发现一个页面的输入字段没有按照我的预期标记。
我有一段时间,但发现获取表单元素然后获取字段的过程是由于没有表单而被错过的原因。 解决方案<
< input>
没有< form>
似乎有效,是(至少对于html 4.01,看起来接近17.2.1的末尾):
用于创建控件
的元素通常出现在FORM
元素中,但也可能出现在
是FORM元素声明的
,它们用于构建用户
接口。这在内部事件的
部分进行了讨论。请注意,表单外的
控件不能是
的成功控件。
Is it valid to have <input>
without it being in a <form>
?
Have a process for marking up some fields in pages and just found a page with input fields that where not being marked up as I expected.
It's taken me a while but worked out that the process of getting the form elements then getting the fields is what caused these to be missed because there is no form.
<input>
without a <form>
appears valid, yes (at least for html 4.01, look near the end of 17.2.1):
The elements used to create controls generally appear inside a FORM element, but may also appear outside of a FORM element declaration when they are used to build user interfaces. This is discussed in the section on intrinsic events. Note that controls outside a form cannot be successful controls.
这篇关于是<输入>没有< form>?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!