HTML <textarea> readonly attribute
Definition and Usage
readonly
The attribute is a boolean attribute.
When present, it specifies that the text area should be readonly.
In a readonly text area, the content cannot be changed, but the user 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, it is necessary to use JavaScript to remove the readonly value and make the text area editable.
Example
Readonly text area:
<textarea readonly> ໃນ codew3c.com, ທ່ານຈະຮຽນການພັດທະນາເວັບໄຊ. ພວກເຮົາສະໜອງການສຶກສາບໍ່ເສຍຄ່າທັງໝົດຂອງທັງໝົດເທັກນິກພັດທະນາ Web. </textarea>
Syntax
<textarea readonly>
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |