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

HTML Referenzhandbuch

HTML-Tag-Übersicht

HTML: <textarea> readonly Eigenschaft

Die readonly-Eigenschaft ist eine boolesche Eigenschaft, die die readonly-Eigenschaft spezifiziert, dass das Textfeld lesbar sein sollte. In einem lesbaren Textfeld kann der Inhalt nicht geändert werden, aber der Benutzer kann es markieren, hervorheben und Inhalte daraus kopieren.

 HTML <textarea> Tag

Online-Beispiel

Ein lesbares Textfeld:

<textarea readonly>
HTML wird Hyper-Text-Markup-Sprache genannt und ist eine kennzeichnende Sprache. Sie umfasst eine Reihe von Tags. Durch diese Tags kann die Formatierung von Dokumenten im Internet vereinheitlicht werden, so dass die verstreuten Ressourcen des Internets zu einem logischen Ganzen verbunden werden.3codebox.com Basic Tutorial
</textarea>
Test See ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the readonly attribute.

Definition and Usage

The readonly attribute is a boolean attribute.

The readonly attribute specifies that the text area should be read-only.

In a read-only text area, the content cannot be changed, but the user can tag it, highlight it, and copy content from it.

You can set the readonly attribute to prevent users from using the text area until other conditions are met (such as checking a checkbox, etc.). Then, you need to use JavaScript to remove the read-only value and make the text area editable.

HTML 4.01 With HTML5Differences

None.

Differences between HTML and XHTML

In XHTML, attribute shorthand is prohibited, the readonly attribute must be defined as <textarea readonly="readonly">.

Syntax

<textarea readonly>
 HTML <textarea> Tag