HTML textarea tag


Definition of HTML textarea tag

HTML multiline textarea is used to show multiline input box. This input box can contain an unlimited number of lines for the user to enter text messages.

A text area holds rows and columns where the user puts a large number of texts.



Syntax

An example to show HTML multiline textarea inside HTML form tag.

Output



What is the HTML multiline textarea?

A HTML multiline textarea is the box where the user can enter unlimited length text. You can define the rows and columns of the textarea to define its size. User can enter larger, longer text with these defined sizes.

When a user enters text larger than the defined size. A vertical scrollbar will appear.

List of HTML textarea tag attributes

Sr. No. Atribute names Description
1 autocomplete This attribute used to specify the textarea field to autocomplete using the user history. By default the value of this attribute is on.

  • The value for autocomplete can be

    • on
    • off
2 cols Define the width of the textarea.

  • cols holds a numeric value
3 disabled make text area disable.

  • value is disabled.
4 form relates the textarea with the forms.

  • It holds the value as the form Id.
5 maxlength define the maximum character user allowed to enter in the textarea.

  • It holds an numeric value.
6 minlength minimum character allowed in the textarea defined by this attribute.

  • It holds a numeric value
6 name Define a name for this field.
7 placeholder Specify a text in this attribute to give the user some hints.
8 readonly make text area only to read and user not able to put any value.
9 required make textarea required for the user to put some value.
10 rows define the height of the textarea. This specifies how many rows visible to the user in textarea.

  • This holds a numeric value.
11 wrap Defines the wrapping of the textarea on submission in the form.

  • value can be hard and soft.

See W3C Specification for this tag.