HTML <textarea> readonly attribute
Definition and Usage
readonly
The attribute is a boolean attribute.
When present, it specifies that the text area should be read-only.
In a read-only text area, the content cannot be changed, but users can switch to it with the Tab key, highlight it, and copy the content from it.
Can be set readonly
Properties to prevent users from using the text area until certain other conditions are met (such as checking a checkbox, etc.). Then, you need to use JavaScript to remove the readonly value and make the text area editable.
Example
Read-only text area:
<textarea readonly> At codew3c.com, you will learn how to develop websites. We provide free tutorials for all Web development technologies. </textarea>
Syntax
<textarea readonly>
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |