×

html · level 2 · unit 2 · lesson 4

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

<textarea> gives visitors room to write.

An <input> holds one short line. For messages, reviews and special requests, use <textarea>, a that holds many lines. Unlike <input>, it has a closing tag.

rows sets how many lines tall it starts, and maxlength still limits the characters. Anything between the tags starts inside the box, so keep the tags touching for an empty one.

puts grey example words in an empty box. They vanish as soon as someone types, so they help, but never use them instead of a label.

<form>
  <label for="notes">Special requests</label>
  <textarea id="notes" name="notes" rows="4" maxlength="200" placeholder="For example: a window seat"></textarea>
  <button>Book</button>
</form>

Press show my page to see it here.

Even a few spaces between <textarea> and </textarea> end up inside the box.