Last Updated on April 26, 2023 by Roshan Parihar
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
1 |
<textarea cols="number of colums" rows="number of rows">enter textarea default text here...</textarea> |
An example to show HTML multiline textarea inside HTML form tag.
1 2 |
<label for="Message">Message</label> <textarea rows="5" cols="50" name="message">This is a textarea content. Textarea is useful for users to put their message on the website. </textarea> |
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.
|
2 | cols | Define the width of the textarea.
|
3 | disabled | make text area disable.
|
4 | form | relates the textarea with the forms.
|
5 | maxlength | define the maximum character user allowed to enter in the textarea.
|
6 | minlength | minimum character allowed in the textarea defined by this attribute.
|
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.
|
11 | wrap | Defines the wrapping of the textarea on submission in the form.
|
See W3C Specification for this tag.