English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Das HTML- <textarea>-Element stellt einen mehrzeiligen reinen Text-Editor-Kontrollfeld dar. Die Anfangs- und End-Tags dürfen nicht weggelassen werden.
Ein HTML-Textbereich (textarea):
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Grundlagen-Tutorial(oldtoolbag.com)</title> </head> <body> <textarea name="textarea" rows="10" cols="50">Schreiben Sie etwas hier</textarea> </body> </html>Testen Sie es heraus ‹/›
IEFirefoxOperaChromeSafari
Alle gängigen Browser unterstützen den <textarea>-Tag.
Der <textarea>-Tag definiert ein mehrzeiliges Texteingabefeld.
Ein Textarea kann unendlich viele Texte enthalten, und der Standardfont der Texte ist ein Breitenschriftfont (normalerweise Courier).
Die Größe des Textareas kann durch die cols- und rows-Attribute festgelegt werden, aber ein besseres Verfahren ist die Verwendung der height- und width-Attribute von CSS.
HTML5 Fügte einige neue Eigenschaften hinzu.
New: HTML5 new attributes.
Attribute | Value | Description |
---|---|---|
autofocusHTML5 | autofocus | Specifies that the text area should automatically receive focus when the page is loaded. |
cols | number | Specifies the visible width of the text area. |
disabled | disabled | Specifies that the text area should be 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 short hint that describes the expected value for the text area. |
readonly | readonly | Specifies that the text area should be 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 a form is submitted. |
<textarea> Tag Supports Global Attributes of HTML.
<textarea> Tag Supports HTML Event Attributes.
HTML DOM Reference Manual:Textarea Object