Step 30
Although not required forlabel
elements with a nestedinput
, it is still best-practice to >explicitly link alabel
with its correspondinginput
element.
Link the
label
elements with their correspondinginput
elements.
Sorry, your code does not pass. Try again.
Hint
You should give the first
label
afor
attribute matching theid
of itsinput
element.
I see classes but I don’t see anywhere where we specified ID’s so I am lost.
<ul class="answers-list">
<li>
<label for="radio">
<input type="radio" />
</label>
</li>
<li>
<label for="radio">
<input type="radio" />
</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="radio">
<input type="radio" />
</label>
</li>
<li>
<label for="radio">
<input type="radio" />
</label>
</li>
</ul>
Challenge: Learn Accessibility by Building a Quiz - Step 30
Link to the challenge: