Select and Textarea
Some answers need more than a single line. HTML provides <select> for a dropdown and <textarea> for longer text. A <select> contains <option> elements. Each option is one choice. The visitor chooses one option from the list unless you intentionally allow multiple choices. A <textarea> is useful for messages, comments, descriptions, and other longer text. Unlike <input>, it has an opening and closing tag because its content can contain text. Both controls should have labels, just like other form fields.
Why this matters
- ·Dropdowns keep a list of choices compact.
- ·Textarea gives users room for longer messages.
- ·Labels make both controls easier to understand.
Common mistakes
- ·Too many dropdown choices can be difficult to scan.
- ·A textarea without a useful label can be confusing.
- ·Do not use a dropdown when a short list of visible choices would be easier.
Frequently asked questions
Option elements.
Practice questions
Question 1
Create a country dropdown with three options.
Question 2
Create a message box with five rows.
Quick check
Just for this topic answer honestly, then check yourself.
1 / 3
