告诉我们发生了什么:
步骤 31
为 label
元素添加文本,使 input
在文本之前。 然后,给 input
元素一个与文本匹配的 value
。
文本应为 True
或 False
。
你目前的代码
<ul class="answers-list">
<li>
<label for="q1-a1">
<input type="radio" id="q1-a1" value="ture" />aaa
</label>
</li>
<li>
<label for="q1-a2">
<input type="radio" id="q1-a2" value="ture" />ggg
</label>
</li>
</ul>
</fieldset>
</div>
<div class="question-block">
<p>2</p>
<fieldset class="question" name="html-question-two">
<legend>
A label element nesting an input element is required to have a
for attribute with the same value as the input's id
</legend>
<ul class="answers-list">
<li>
<label for="q2-a1">
<input type="radio" id="q2-a1" value="ture" />sss
</label>
</li>
<li>
<label for="q2-a2">
<input type="radio" id="q2-a2" value="ture" />vvv
</label>
</li>
</ul>
警告
挑战的种子代码和/或你的解决方案超过了我们从挑战传送的最大长度。
你需要在此采取额外步骤,以确保你写的代码可以轻松地被阅读。
请复制/粘贴所有在挑战中编辑器所显示的代码。
用你的复制代码替换这两句。
请保留上方的 ``` 行和下方的 ``` 行
因为它们允许你的代码在帖子中被正确格式化。
你的浏览器信息:
用户代理是: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.47
挑战: 通过编写小测验学习无障碍 - 步骤 31
挑战的链接: