Learn Accessibility by Building a Quiz - Step 38

Tell us what’s happening:

i’ve already given the id attributes to my select elements but still my code doesn’t passed … and the suggestion is you should give the select elemnt id attributes

Your code so far

<!-- file: index.html -->
<!-- User Editable Region -->

            <div class="question-block">
              <label for="select" select id="">Can the CSS margin property accept negative values?</label>
            </div>
            <div class="answer">
              <select id="" required>
                <option value="">Select an option</option>
                <option value="yes">Yes</option>
                <option value="no">No</option>
              </select>
            </div>

<!-- User Editable Region -->
/* file: styles.css */

Your browser information:

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

Challenge Information:

Learn Accessibility by Building a Quiz - Step 38

You need to link the label element with the select element by having the value of the “for” attribute (on the label element) the same as the value of the ID attribute on the select element.

You have added extra code into the label element which is not needed. and you have not added a value to the ID attribute in the select element.

You were also asked to add a name attribute to the select element which you have not done.

1 Like

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