Textarea, online

Six activities your students do on their own devices. See who's finished, and their scores.

Textarea in one minute

What students need to know

'Your notes here.' is pre-filled default content placed between the tags. Unlike <input>, textarea is never self-closing. name="comment" ensures the textarea value is sent as comment=entered_text when the form is submitted.

rows sets the number of visible text lines. The CSS height property can also control size, but rows is the HTML attribute. HTML tag names must be lowercase. <TEXTAREA> is non-standard — use <textarea>.

Mistakes students make

  • HTML tag names must be lowercase. <TEXTAREA> and </TEXTAREA> should be <textarea> and </textarea>.
  • The name attribute value must be in double quotes: name="msg", not name=msg without quotes.
  • The rows attribute value must be in double quotes: rows="5", not rows=5 without quotes.
  • The closing tag is missing its forward slash. It should be </textarea> not <textarea>.

Discover other journeys with this module

What students will learn in this module

Every question in Module 31

Quick questions

  1. True or false: <textarea> is self-closing like <input>.ATrueBFalse
  2. Which attribute sets the visible height of a textarea in lines?AheightBrows
  3. True or false: <TEXTAREA> with capital letters is valid HTML.AFalseBTrue
  4. How do you set the default text shown inside a textarea?APlace the text between the opening and closing tagsBUse the value attribute
  5. Which attribute sets the visible width of a textarea in character widths?AcolsBwidth

Key terms

Students type the meaning of:

  • <textarea>

Match the pairs

<textarea name="msg" rows="5">
  Hello world.
</textarea>
Match it to what it does
<textarea name="bio" cols="40">
</textarea>
Match it to what it does
<textarea> requires opening and closing tags — default content goes between themMatch it to what it does
The name attribute on textarea identifies its value when the form is submittedMatch it to what it does
<TEXTAREA name="msg">Hello</TEXTAREA>Match it to what it does
<textarea name="bio"/>Match it to what it does

Fill in the blanks

  1. <________ name="msg">Hello</textarea>

    Hint: Type the element name that creates a multi-line text input

  2. <textarea name="bio">Bio text</________)

    Hint: Type the element name for the closing tag of a multi-line text area

  3. <textarea name="msg" ____="5">Text</textarea>

    Hint: Type the attribute name that sets the visible height in lines

  4. <textarea name="n" ____="40">Text</textarea>

    Hint: Type the attribute name that sets the visible width in characters

  5. <form>
      <________ name="bio" rows="4">
      </textarea>
    </form>

    Hint: Type the element name used to create a multi-line text input inside a form

Spot the error

Question 1

A<TEXTAREA name="msg">Hello</TEXTAREA>B<input type="text" name="q">C<button>Submit</button>

Question 2

A<form>B  <textarea name=msg>Enter text</textarea>C  <button>Submit</button>D</form>

Question 3

A<form>B  <input type="text" name="q">C  <textarea name="body" rows=5>D  <button>Save</button>E</form>

Question 4

A<form>B  <textarea name="bio">C    Tell us about yourself.D  <textarea>E</form>

Question 5

A<form>B  <textarea name="a">One</textarea>C  <textarea name="b">Two</textarea>D  <textarea name="c">Three</textarea>E  <Textarea name="d">Four</Textarea>F</form>