Am I starting to apply knowledge?!

Tell us what’s happening:

I know what I have to do to correct my code, but I want to point out that the error I received was not from a lack of knowledge. A select attribute is not required to be applied on a select tag. Should clarity be provided in the task instructions or are we testing knowledge application right now and requiring best practices to be applied…and I am doing good, better than I thought!? I hope I make sense!

Your code so far

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

            <div class="answer">
              <select>
                <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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36

Challenge Information:

Learn Accessibility by Building a Quiz - Step 37

Welcome to the forum @seevyaj222

For this project, the form element is sending data to a server.
So that the server receives the relevant information from the user, a required attribute is applied to the select element, to make sure the user inputs a selection.

So depending on what information a user needs to supply before they can submit the data, a required attribute may be necessary.

For this app it is necessary.

Happy coding

1 Like

Based this MDN document about HTML attribute: required - HTML: HyperText Markup Language | MDN, I don’ t think there is another practice for making a selection required for submitting a form.

The test is explicitly asking for a required select element, so it seems to be testing if we know to put the required attribute in the opening tag of select and not about best practices.

You took the time to ask and learn so I’d say you are doing great! Front End, Back End, Dev Ops… keep going. :clap:

1 Like