<form id="youtube-form" method="post" action="">
<label for="searchField" id="label-youtube-id">YouTube ID:</label>
<input type="text" id="searchField" name="videoid" class="search-field" />
<fieldset id="outputFieldset">
<legend>Output format:</legend>
<label for="flv">FLV</label>
<input type="radio" id="flv" name="format" class="radio-button" value="flv" />
<label for="avi">AVI</label>
<input type="radio" id="avi" name="format" class="radio-button" value="avi" />
<label for="mp3">MP3</label>
<input type="radio" id="mp3" name="format" class="radio-button" value="mp3" />
</fieldset>
<input id="youtube-submit" type="submit" name="submit" value="Submit" />
</form>
这段代码有什么问题?我验证时似乎遇到错误。 (也是三个)
Line 21, Column 49: document type does not allow element "label" here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "address", "fieldset" start-tag
是因为我需要添加更多字段集,还是我做错了什么?
非常感谢任何帮助:)
最佳答案
input
和 label
元素不允许作为 form
元素的子元素。
ins
、del
、h1
、h2
、h3
、 >h4
、h5
、h6
、p
、div
、地址
>、fieldset
允许作为子元素,也允许将 input
和 label
元素作为其子元素(尽管大多数在语义上并不合适) .
关于html - 字段集验证。字段集位于表单内部,并在外部有输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1509119/