HTML textarea - how to use <textarea> tag

The HTML <textarea> tag is used to define a multi line input control. The cols and rows attributes can be used to define the width and height of the textarea.

Attributes

The textarea tag supports the global and event attributes.

autofocus
Defines that the textarea should automatically get focus when the page loads.
cols
Defines the number of visible columns of the textarea
dirname
Defines the direction of text the textarea's value will be submitted
disabled
Defines if the textarea should be disabled
form
Defines one or more form ids the textarea is related to
maxlength
Defines the maximum number of characters a user can type in the textarea
name
Defines the name of the textarea
placeholder
Defines a hint for the textarea
readonly
Defines if the textarea should be readonly
required
Defines that the textarea is required
rows
Defines the number of visible rows in the textarea
wrap
Defines whether the value of the textarea should be wrapped when submitted. Possible values are "hard" and "soft".

Examples:

<body> <form> <textarea id="t1" cols="20" rows="4" wrap="soft"></textarea> </form> </body>

Related HTML tags: