Home › HTML Masterclass › Forms & Inputs
Module 7: Dropdown & TextareaIntermediate

28. Dropdowns and Long Messages (<select>, <textarea>, <datalist>)

A dropdown list of states, a long feedback box and auto-search suggestions

Real-life analogy

Just as in online shopping a long list opens downward for choosing your State, select and option do the same thing.

Explanation

Other important form elements:

  • <select> and <option>: For creating a dropdown menu (Drop-down list).
  • <textarea>: For writing a long multi-line message or address. Its size is set with rows and cols.
  • <datalist>: Magical auto-search! Shows suggestions while you type in an input box.

Golden rules

  • The closing tag </textarea> is mandatory for <textarea>.

Common mistake

Writing textarea as a self-closing