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
 |
|
Get Your Diploma!
W3Schools' Online Certification Program is the perfect solution for busy
professionals who need to balance work, family, and career building.
The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate is for developers who want to document their knowledge of JavaScript and the HTML DOM.
The XML Certificate is for developers who want to document their knowledge of XML, XML DOM and XSLT.
The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.
The PHP Certificate is for developers who want to document their knowledge of PHP and SQL (MySQL).
|
|