Easy Tutorial
❮ Att Dir Compact Att Button Value ❯

HTML <textarea> readonly Attribute

HTML <textarea> Tag

Example

A read-only text area:


Browser Support

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 is read-only.

In a read-only text area, the content cannot be modified, but users can tab to the control, select or copy the text.

The readonly attribute can be set until certain conditions are met (such as selecting a checkbox), then restore user control over the text area. JavaScript can be used to remove the readonly attribute value to make the text area editable.


Differences Between HTML 4.01 and HTML5

None.


Differences Between HTML and XHTML

In XHTML, attribute minimization is forbidden, and the readonly attribute must be defined as <textarea readonly="readonly">.


Syntax


❮ Att Dir Compact Att Button Value ❯