Lesson 11 of 15

Textarea & Select

Textarea and Select

<textarea> — multi-line text input:

<textarea rows="4" cols="50" placeholder="Your message"></textarea>

Unlike <input>, <textarea> has a closing tag and its default content goes between the tags.

<select> — dropdown menu:

<select name="country">
  <option value="us">United States</option>
  <option value="uk">United Kingdom</option>
  <option value="ca" selected>Canada</option>
</select>

The selected attribute pre-selects an option. <optgroup> groups options:

<select>
  <optgroup label="Europe">
    <option>France</option>
    <option>Germany</option>
  </optgroup>
</select>

Your Task

Create a form with a <textarea> and a <select> dropdown with at least 2 options.

HTML preview loading...
Loading...
Click "Run" to execute your code.