English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
O elemento <textarea> HTML representa um controle de edição de texto multilinha. As tags de início e fim não podem ser omitidas.
Um textarea HTML (textarea):
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Manual Básico(oldtoolbag.com)</title> </head> <body> <textarea name="textarea" rows="10" cols="50>Escreva algo aqui</textarea> </body> </html>Teste e veja ‹/›
IEFirefoxOperaChromeSafari
Todos os navegadores populares suportam a tag <textarea>.
A tag <textarea> define um controle de entrada de texto multilinha.
O textarea pode conter uma quantidade ilimitada de texto, e o texto por padrão é de fonte monoespacial (geralmente Courier).
Pode-se definir o tamanho do textarea usando as propriedades cols e rows, mas a melhor maneira é usar as propriedades height e width do CSS.
HTML5 Adicionou algumas novas propriedades.
New: HTML5 new attributes.
Attribute | Value | Description |
---|---|---|
autofocusHTML5 | autofocus | Specifies that the text area automatically receives focus when the page is loaded. |
cols | number | Specifies the visible width of the text area. |
disabled | disabled | Specifies that the text area is disabled. |
formHTML5 | form_id | Defines one or more forms that the text area belongs to. |
maxlengthHTML5 | number | Specifies the maximum number of characters allowed in the text area. |
name | text | Specifies the name of the text area. |
placeholderHTML5 | text | Specifies a brief hint that describes the expected input value of the text area. |
readonly | readonly | Specifies that the text area is read-only. |
requiredHTML5 | required | Specifies that the text area is required./Required. |
rows | number | Specifies the number of visible lines in the text area. |
wrapHTML5 | hard soft | Specifies how the text in the text area should be wrapped when the form is submitted. |
<textarea> tag supports HTML global attributes.
<textarea> tag supports HTML event attributes.
HTML DOM reference manual:Textarea object