以下是允许的吗?
<input type="hidden" name="field" />
Run Code Online (Sandbox Code Playgroud)
XHTML 1.1的模式说,value是不是强制性的:
<xs:attributeGroup name="xhtml.input.attlist">
<xs:attributeGroup ref="xhtml.Common.attrib"/>
<xs:attribute name="type" type="xhtml.InputType.class" default="text"/>
<xs:attribute name="name" type="xh11d:CDATA"/>
<xs:attribute name="value" type="xh11d:CDATA"/>
<xs:attribute name="checked">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="checked"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="size" type="xh11d:Number"/>
<xs:attribute name="maxlength" type="xh11d:Number"/>
<xs:attribute name="src" type="xh11d:URI"/>
<xs:attribute name="tabindex" type="xh11d:Number"/>
<xs:attribute name="accesskey" type="xh11d:Character"/>
</xs:attributeGroup>
Run Code Online (Sandbox Code Playgroud)