Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

When making a form in HTML, which input type do I use to get a drop down menu of states?

Trying to add a a drop down list of US states to my form document. I have checked the Treehouse blog post about forms and read through the MDN info but I haven't found an answer for which type to use to create this drop down form list. Thank you!

4 Answers

You need a <select> element.

Here's a link to s3schools page on select: http://www.w3schools.com/tags/tag_select.asp

Thank you!

You want to use the select and option tags. Then style it in your css. Hope this helps. If you need examples, let me know. Treehouse rocks!!!

Thank you!

You want to use the select and option tags. Then style it in your css. Hope this helps. If you need examples, let me know. Treehouse rocks!!!

I think what he's asking, is what I'm curious about too. The instructions for project 3 state that "every input should have the necessary attributes ID, Type, Name". I am also thinking about this semantically for maybe screen readers and other assisted technologies. I would think that "type" would serve some sort of purpose in that regard. However, when looking at the list of types, I don't know what type a dropdown (of states or other categories) would be. Is it just type="states" or could I put type="list of states"? I don't know if a screen reader would read that.

At any rate, it didn't seem anyone specifically touched on this for John O'Conner. I'll post on slack as well.