Learn Accessibility by Building a Quiz - Step 37

Tell us what’s happening:
I get the hint that I should give the label element a for attribute but even after doing that the code doesn’t pass. Any help please?

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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36

Challenge: Learn Accessibility by Building a Quiz - Step 37

Link to the challenge:

Hey! can you copy paste the code that you’re using to pass the challenge? This would make it easier for others on the site to help you. thanks!

you have to use ``` to write code

1 Like

Here is the code am using to pass the challenge?

<div class="question-block">
             <select name="blocky"><label for="frontend">Are you a frontend developer?</label></select>
            </div>
            <div class="answer">
              <select required>
                <option value="">Select an option</option>
                <option value="yes">Yes</option>
                <option value="no">No</option>
              </select>
            </div>

learning to read and debug error is a great skill to have when you’re learning to program.

This is the error that pops up when you try to submit your code.

image

but you already have a for attribute in your code right? so it should pass. but the problem is that your label element is intermixed with a select element. i would suggest you to remove label element from inside the select element and turn this

 <select name="blocky">
     <label for="frontend">Are you a frontend developer?</label>
</select>

<label for="frontend">Are you a frontend developer?</label>

and then try to add the id attribute to your remaining select element. that seemed to work for me! :smile:

3 Likes