Help! You should give the first input a value matching the label text content

Am stuck with the puzzle

<ul class="answers-list">
                <li>
                  <label for="q1-a1">
                    <input type="radio" id="q1-a1" name="true" />True
                  </label>
                </li>
                <li>
                  <label for="q1-a2">
                    <input type="radio" id="q1-a2" name="false" />False
                  </label>
                </li>
              </ul>

Is this for a challenge? We’d need a link to that - we don’t have them all memorized.

yes, it is for a challenge. here is the link https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-accessibility-by-building-a-quiz/step-31

OK, so this is for the first set of radio buttons, you have this…

I see the instructions:

Give the label elements text such that the input comes before the text. Then, give the input elements a value matching the text.

Does the value you’ve given match the text of the label? Exactly?

1 Like

hi man, I got hung up on this for a minute as well. simply change the name attribute to value and it reads correct,

1 Like

Just replace the name attribute in the input from (name) to value like that
The value attribute is a good way to link the label to the input
Don’t use the name attribute for linking the label instead use the name attribute same in radio buttons the radio buttons that have same name attribute value can be selected one at one time

redacted by mod
1 Like

Welcome to the forum and thank your for joining in.

Please be aware that this is a learning platform so we don’t like to just give the answer, especially something that can just be cut and pasted. We try to guide the person to the right answer, especially if it is a curriculum problem.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.