Learn Accessibility by Building a Quiz - Step 31 - cdtbDcyJ2OE4eH_TWY0oG

Tell us what’s happening:
I am really struggling with this ; Step 31

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

The text should either be True or False.

Your code so far



  • True




  • False

                </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="text">True</label>
                    <input type="radio" id="q2-a1" name="q2-a1"/>
                  
                </li>
                <li>
                  <label for="q2-a2"><input type="text">False</label>
                    <input type="radio" id="q2-a2" name="q2-q2"/>
                  
                </li>
              </ul>
    

    WARNING

    The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

    You will need to take an additional step here so the code you wrote presents in an easy to read format.

    Please copy/paste all the editor code showing in the challenge from where you just linked.

    Replace these two sentences with your copied code.
    Please leave the ``` line above and the ``` line below,
    because they allow your code to properly format in the post.
    
    

    Your browser information:

    User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.124 Safari/537.36 Edg/102.0.1245.44

    Challenge: Learn Accessibility by Building a Quiz - Step 31

    Link to the challenge:

Hi

From the instructions:

Then, give the input elements a value matching the text.

So you need to add a value attribute to each input element.
That attribute’s value should be the same as the label text for that input.

I’d also add a space before each True/False text to separate it from the radio buttons.

When I look at this step, I don’t see a name attribute on the radio buttons.
Did you add those?
This step doesn’t ask for them (I assume they’ll be added in a later step).

Thank you i’m still not getting it

Could you explain a little more?

What exactly are you having difficulty with?

I seemed to have tried everyway of doing it but seems to still come back as incorrect. I just cant sort the value part out. no matter what i have done it comes back with:

“You should give the first input a value matching the label text content.”

It’s just an attribute, like the ones you’ve been adding to elements all through the course so far.

There are some examples of the value attribute here - perhaps that might help.

          <ul class="answers-list">
            <li>
              <label for="q1-a1"><input type="text" value="True"> True
                <input type="radio" id="q1-a1" />
              </label>
            </li>
            <li>
              <label for="q1-a2"><input type="text" value="False"> False
                <input type="radio" id="q1-a2" />
              </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="text" value="True"> True
                <input type="radio" id="q2-a1" />
              </label>
            </li>
            <li>
              <label for="q2-a2"><input type="text" value="False"> False
                <input type="radio" id="q2-a2" />
              </label>
            </li>
          </ul>

The instructions don’t ask you to add any new input elements.

You have to add the value attribute to the existing radio button input elements.

1 Like
  • True
  • False

2

A label element nesting an input element is required to have a for attribute with the same value as the input's id
  • True
  • False