FAQ: Learn HTML: Forms - Dropdown list

This community-built FAQ covers the “Dropdown list” exercise from the lesson “Learn HTML: Forms”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Introduction to HTML

FAQs on the exercise Dropdown list

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

why do we need to create id atrribute

So the user can see the input area attached to the description text. Notice how when you click on “What type of bun would you like?”, the dropdown box highlights.

I tried using the strong and em tags to format the text that is displayed in the drop-down by nesting these tags under the option tag, but it does not seem to work. How can i format the individual elements in the drop-down?

So if we don’t select any option, the first option will be selected by default?
If yes, then is there any way to stop it?

For eg: If in the excercise if we don’t select any option then by I think “sesame” will be selected by default. Is there any way we can set another option, say “select any one” as default which does not allow progression if we don’t select any one of the options prrovided.

Attributes are very useful to customize behavior, in this case you need to use selected attribute:



According to Interneting Is Hard, a great tutorial on HTML/CSS, styling a dropdown menu is extremely hard. It recommends using Bootstrap or jQuery to customize a dropdown menu.

1 Like

Why does the picture of the code below show two arrows, an up and a down one? Shouldn’t it be just a down one? Also, is there a way to send feedback directly to codeacademy? I think giving the option for people to provide feedback when they encounter something wrong would be beneficial for them.

Is it ok to create a “None” option if the user didn’t want any of the options from the drop down list.
E.g None

sure, just set the value attribute to an empty string

Why does select not require an input tag?

if I wanted to make more than one item on the drop down list clickable how would I do this or is there a more compacted way of doing this without using checkboxes

using <select> element:


you have a multiple attribute, which, well i suppose you can guess what it does :wink:

1 Like

After practicing this exercise in codepen, I had codepen “analyze html” and it produced the following result.

So, is this accurate? Thank You.

this is the official tool:


i assume codepen implements it

you forgot the > to close the form opening tag. As such, label is seen as an attribute while it should be a child element.

1 Like

Is there a common practice of ordering attributes or should I just create my own order and stick to it through the whole file?

I think this stackoverflow question answers it nicely:


not the accepted answer, but the second high one (with higher upvotes)

1 Like

I had already read that answer before posting my question, but I wanted to see if people in this forum thought about it differently.

Now that I see that you don’t, I’ll follow that piece of advice confidently.


Stackoverflow is generally very trustworthy. I do also agree with the answer in this case (just like many times before)

1 Like

Nice to know. I will rely more on Stackoverflow for future doubts.