Anonymous contributor's avatar
Anonymous contributor
Anonymous contributor's avatar
Anonymous contributor
Published Jan 27, 2023
Contribute to Docs

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

All contributors

Looking to contribute?

Learn HTML on Codecademy