From the course: HTML and CSS: Creating Forms

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Select element

Select element

- [Instructor] In this video, we're going to look at how to use the select element to allow users to choose between multiple options. The select element is what you use when you have multiple options, but don't want to take up very much room on the screen. This is commonly called a dropdown menu. For this example, I'm going to ask someone to choose what toppings they want on their pizza. So I'm going to start with the select element. So select and like an input element, it needs a name and ID, and I'll use the word pizza. So name equals pizza and ID equals pizza. Unlike the input element, the select element needs a closing tag because the options will go inside it. So there's my closing select. So option is a separate element and you can have one or more options. Each option will be nested inside the select element. The content inside the option element is what you'll see on the screen. So here I'm going to do option and then what I want to show on the screen, so let's say pepperoni…

Contents