HTML <textarea> (Multiline Text Input) Tag

❮ Previous Home Next ❯


<form action="action.php">
  <textarea name="textareaText">Hello world!</textarea>

  <input type="submit" value="Submit">


The <textarea> element specifies a multiline text input field contained within a form.

A text area can hold an unlimited number of characters, and the text renders in a fixed-width font (usually Courier).

Any text between the <textarea> and </textarea> tags is rendered as the default entry for the form control. Content within a textarea element is not interpreted, so white space is preserved and tags themselves are ignored.

Note: A <textarea> tag cannot be a descendent of an <a>a (anchor) or <button> element.

Version: HTML 2, 3.2, 4, 4.01, 5

Standard Syntax

<textarea cols="number" rows="number">...</textarea>

Browser Support



Attribute Value Description
autocapitalize none
Specifies the text value should be automatically capitalized as it is entered/edited by the user.
autocomplete off
Specifies that the textarea should automatically get completed when the document is loaded.
autofocus autofocus Specifies that the textarea should automatically get focus when the document is loaded.
cols number Specifies the expected maximum number of characters per line. by default, it is 20.
dirname uniqueName.dir Specifies the submission of the text direction of the textarea
disabled disabled This boolean attribute disables the textarea for user input or interaction.
form formId Specifies the form that the textarea is associated with i.e. its "form owner".
maxlength number Specifies the maximum number of characters that the user can enter in the textarea.
minlength number Specifies the minimum number of characters required that the user should enter in the textarea.
name unique-name Specifies a name to the textarea control.
placeholder text Specifies the user of what can be entered in the textarea. Placeholder text must not contain line breaks.
readonly readonly Specifies that the user cannot modify the value of the textarea control (i.e. read-only).
required required Specifies that the user must fill in a value before submitting the form.
spellcheck default
Specifies whether the <textarea> is subject to spell checking by the underlying browser/OS.
rows number Specifies the visible width in average character widths.
wrap hard
Specifies how the value of the textarea is to be wrapped for form submission.

Global Attributes

The <textarea> element also supports the Global Attributes in HTML.

Event Attributes

The <textarea> element also supports the Event Attributes in HTML.

By Default CSS Value(s)


❮ Previous Reference Next ❯