the challenge says i should link the labels with their corresponding input explicitly.
below is my code. Any help
<input type="radio"name="radio-button"id=“radio-button”/>
the challenge says i should link the labels with their corresponding input explicitly.
below is my code. Any help
<input type="radio"name="radio-button"id=“radio-button”/>
You link a label to an input by adding the for
attribute to the label and setting its value to the id
of the input. If you are still stuck then we would need to see your HTML in order to help you further.
To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key.
<ul class="answers-list">
<li>
<input type="radio"name="radio-button"id="radio-button"/>
<label for="radio-button"></label>
</li>
<li>
<input type="radio"name="radio-button"id="radio-button" />
<label for="radio-button"></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>
<input type="radio"name="radio-button"id="radio-button" />
<label for="radio-button">
</label>
</li>
<li>
<input type="radio"name="radio-button"id="radio-button" />
<label for="radio-button">
</label>
</li>
</ul>
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.