A multi-row text area form element. The HTML <textarea> tag is used within a form to declare a textarea element - a control that allows the user to input text over multiple rows.

In HTML 5, the maxlength attribute enables you to specify a maximum length for your <textarea> element. This attribute was not supported in previous versions of HTML.

The initial value of the text area can be placed in between the opening and closing tags.

Also see the <form> tag.

Required Attributes

  • rows is used to define the number of viewable rows.
  • cols is used to specify the number of viewable columns.

Optional Attributes

  • name can be used so that the value of the element can be processed.
  • disabled can be used to disable the element. It must be used in the format disabled="disabled".
  • readonly can be used to specify that the value of the element can not be changed. It must be used in the format readonly="readonly".
  • accesskey can be used to associate a keyboard shortcut to the element.
  • tabindex can be used to specify where the element appears in the tab order of the page.
  • Common attributes

Example

<form action="/folder/scriptfile.php" method="post">
	<p>Your address</p>
	<textarea  name="address"cols="30" rows="4"></textarea>
	<div><input type="submit" /></div>
</form>

Changes in HTML5

  • None.

Related Tags