The <textarea> element defines a box for multi-line plain-text input that is collected from the user.


  <!-- Content here -->

Attributes are optional.


Commonly used attributes are shown in the table below:

Attribute Data Type Description
id String Links to <label> element.
name String Name of the table.
rows Integer Define the initial rows number.
cols Integer Define the initial columns number.

When not given, the default value is 20 for cols and 2 for rows.


The following example demonstrates <textarea> with several attributes defined and an associated <label> element:

<head> </head>
<label for="textbox">Share your thoughts:</label>
<textarea id="textbox" name="textbox" rows="1" cols="30">
Okay, here's the situation...

This will display:

HTML Elements Textarea label


Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn HTML on Codecademy