HTML 5 <textarea> tag
Definition and Usage
Defines a text-area (a multi-line text input control). A user can write text
in the text-area. In a text-area you can write an unlimited number of
characters. The default font in the text-area is fixed pitch.
Differences Between HTML 4.01 and HTML 5
HTML 5 has some new attributes, and some HTML 4.01 attributes are no longer
supported.
Example
| Source |
Output |
<textarea rows="2" cols="20">
The cat was playing in the garden. Suddenly a dog showed up.....
</textarea> |
|
Attributes
- 4: indicates if the attribute is defined in HTML 4.01
- 5: indicates if the attribute is defined in HTML 5
| Attribute |
Value |
Description |
4 |
5 |
| autofocus |
true
false |
Makes the textarea focused on page load |
|
5 |
| cols |
number |
Specifies the number of columns visible in the text-area |
4 |
5 |
| disabled |
true
false |
Disables the text-area when it is first displayed |
4 |
5 |
| form |
true
false |
Defines one ore more forms the textarea belongs to. |
|
5 |
| inputmode |
inputmode |
Defines what kind of input in the textarea to expect |
|
5 |
| name |
name_of_textarea |
Specifies a name for the text-area |
4 |
5 |
| readonly |
true
false |
Indicates that the user cannot modify the content in the text-area |
4 |
5 |
| required |
true
false |
Defines if the textarea's value is required in order to
submit the form. |
|
5 |
| rows |
number |
Specifies the number of rows visible in the text-area |
4 |
5 |
Standard Attributes
| class, contenteditable, contextmenu, dir, draggable, id,
irrelevant, lang, ref, registrationmark, tabindex, template, title |
For a full description, go to Standard
Attributes in HTML 5.
Event Attributes
| onabort, onbeforeunload, onblur, onchange, onclick,
oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave,
ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress,
onkeyup, onload, onmessage, onmousedown, onmousemove,
onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect,
onsubmit, onunload |
For a full description, go to Event Attributes
in HTML 5.
Try-It-Yourself Demos
Textarea
How to create a text-area.
 |
 |
 |
 |
|
The Ektron Intranet
lets you do everything you need to do on your corporate intranet and everything you want to do... all with just one application.
What can you do with the Ektron Intranet? |
 |
Navigate through content, documents, assets, colleagues and workgroups quickly and intuitively with enterprise search |
 |
Communicate with friends and colleagues with forums, message boards and corporate blogging using the new Social Networking Platform |

|
Utilize the extensive out-of-the box features or customize your site through Ektron CMS400.NET's open architecture |
 |
Promote collaboration in your organization through project workspaces where others can efficiently find information and work together |
 |
Author/edit content, manage navigation, menus, audit trails, workflow and approvals with the best in breed Content Management |
|
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
|
|
 |
TAKE THE VIDEO TOUR |
 |
or download a FREE TRIAL today. |
|