HTML <textarea> readonly attribute
HTML <textarea> tag
Example
A text area that is read-only:
<textarea rows="3" cols="25"
readonly="readonly">
At W3Schools you will find all the Web-building tutorials you need, from
basic HTML to advanced XML, SQL, ASP, and PHP.
</textarea> |
Try it yourself!
|
Definition and Usage
The readonly attribute specifies that a text area should be read-only.
In a read-only text area, the content cannot be changed, but a user can tab
to it, and copy and paste the content from it.
The readonly attribute can be set to keep a user
from using a text area until some other condition has been met (like selecting a
checkbox, etc.). Then, a JavaScript is required to remove the readonly value,
and make the text area editable.
Browser Support
The readonly attribute is supported in all major browsers.
Syntax
<texarea readonly="value">
|
Attribute Values
Value |
Description |
readonly |
Specifies that the text area should be read-only |
HTML <textarea> tag
|