A simple text area:
![]()
The <textarea> tag is supported in all major browsers.
The <textarea> tag defines a multi-line text input control.
A text area can hold an unlimited number of characters, and the text renders in a fixed-width font (usually Courier).
The size of a text area can be specified by the cols and rows attributes, or even better; through CSS' height and width properties.
HTML5 has some new attributes: autofocus, form, maxlength, placeholder, required, and wrap.
New : New in HTML5.
| Attribute | Value | Description |
|---|---|---|
| autofocusNew | autofocus | Specifies that a text area should automatically get focus when the page loads |
| cols | number | Specifies the visible width of a text area |
| disabled | disabled | Specifies that a text area should be disabled |
| formNew | form_id | Specifies one or more forms the text area belongs to |
| maxlengthNew | number | Specifies the maximum number of characters allowed in the text area |
| name | text | Specifies a name for the text area |
| placeholderNew | text | Specifies a short hint that describes the expected value of a text area |
| readonly | readonly | Specifies that a text area should be read-only |
| requiredNew | required | Specifies that a text area is required/must be filled out |
| rows | number | Specifies the visible number of lines in a text area |
| wrapNew | hard soft |
Specifies how the text in a text area is to be wrapped when submitted in a form |
The <textarea> tag also supports the Global Attributes in HTML5.
The <textarea> tag also supports the Event Attributes in HTML5.
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $3.98 Unlimited Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Best Website Templates Top CSS Templates |
| CREATE HTML Websites |
| EASY WEBSITE BUILDER |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|