HTML5
HTML5

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.
Your codeHTML
Live preview

Frequently asked questions

Option elements.

Practice questions

Question 1

Create a country dropdown with three options.

Your codeHTML
Live preview

Question 2

Create a message box with five rows.

Your codeHTML
Live preview

Quick check

Just for this topic answer honestly, then check yourself.

1 / 3

Which tag creates a dropdown?