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

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <textarea> autofocus-Eigenschaft

Die autofocus-Eigenschaft ist ein boolesches Attribut. Die autofocus-Eigenschaft legt fest, dass das Textfeld bei dem Laden der Seite automatisch den Fokus erhält.

 HTML <textarea> Tag

Online-Beispiel

Ein Textfeld, das automatisch den Fokus erhält:

<textarea rows="4"cols="5"autofocus>
Bei oldtoolbag.com wird lernen, wie man eine Webseite erstellt. Wir bieten kostenlose Tutorials in allen Web-Entwicklungstechnologien an.
</textarea>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Internet Explorer 10, Firefox, Opera, Chrome and Safari support the autofocus attribute.

Note:Internet Explorer 9 and earlier versions support the autofocus attribute of the <textarea> tag.

Definition and Usage

The autofocus attribute is a boolean attribute.

The autofocus attribute specifies that the text area should automatically receive focus when the page is loaded.

HTML 4.01 with HTML5differences

The autofocus attribute is in HTML5 New attributes for the <textarea> tag.

Differences between HTML and XHTML

In XHTML, attribute abbreviations are prohibited, and the autofocus attribute must be defined as <textarea autofocus="autofocus">.

Syntax

<textarea autofocus>
 HTML <textarea> Tag