Step 30
Although not required forlabelelements with a nestedinput, it is still best-practice to >explicitly link alabelwith its correspondinginputelement.
Link the
labelelements with their correspondinginputelements.
Sorry, your code does not pass. Try again.
Hint
You should give the first
labelaforattribute matching theidof itsinputelement.
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: