Learn Accessibility by Building a Quiz - Step 38

Link the first label element to the select element, and give the select element a name attribute. I gave the label element a for attribute … but it says to give a for attribute to label

Your code so far

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

Your browser information:

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

Challenge: Learn Accessibility by Building a Quiz - Step 38

Link to the challenge:

The for attribute on the label needs to have the same value as the id attribute on the select. So this means you need to add an id attribute to the select as well. Look back at some of the other label/inputs to see how you did it.

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. You may also be able to use Ctrl+e to automatically give you the triple back ticks while you are typing in the this editor and the cursor is on a line by itself. Alternatively, with the cursor on a line by itself, you can use the </> button above the editor to add the triple back ticks.

1 Like
<label for="l1">
              <select required name="s1" id="l1" >
``` still it doesn't work

You want to link the label with the text β€œAre you a frontend developer?” to the select, not add a new label.

thank you … it works

1 Like

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