Learn Accessibility by Building a Quiz - Step 31

Tell us what’s happening:

Your code so far

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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36

Challenge: Learn Accessibility by Building a Quiz - Step 31

Link to the challenge:

hi there, please copy your code into the code block provided in the post so we can see it.

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

I’ve merged the duplicate post you made into this thread and also edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

instead of putting the for attribute inside the input element,
move it to the label opening tag
(do that for all of them)

Now, add a for attribute to each of your four label s that links the label to its corresponding radio input .

It looks like you added the for attributes to the input instead of the label.