English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Manual de Referência HTML

大全 de Tags HTML

HTML: <textarea> tag

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.

Exemplo Online

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 ‹/›

Compatibilidade do navegador

IEFirefoxOperaChromeSafari

Todos os navegadores populares suportam a tag <textarea>.

definição e instruções de uso da tag

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.

HTML 4.01 com HTML5diferenças

HTML5 Adicionou algumas novas propriedades.

Attribute

New: HTML5 new attributes.

AttributeValueDescription
autofocusHTML5autofocusSpecifies that the text area automatically receives focus when the page is loaded.
colsnumberSpecifies the visible width of the text area.
disableddisabledSpecifies that the text area is disabled.
formHTML5form_idDefines one or more forms that the text area belongs to.
maxlengthHTML5numberSpecifies the maximum number of characters allowed in the text area.
nametextSpecifies the name of the text area.
placeholderHTML5textSpecifies a brief hint that describes the expected input value of the text area.
readonlyreadonlySpecifies that the text area is read-only.
requiredHTML5requiredSpecifies that the text area is required./Required.
rowsnumberSpecifies the number of visible lines in the text area.
wrapHTML5hard
soft
Specifies how the text in the text area should be wrapped when the form is submitted.

Global attributes

<textarea> tag supports HTML global attributes.

event attributes

<textarea> tag supports HTML event attributes.

Related articles

HTML DOM reference manual:Textarea object