HTML textarea readonly attribute

Example

A text area that is read-only:
<textarea rows="3" cols="25" readonly="readonly">
1000source codes is to share tutorials on all programming language
</textarea>


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
Share this article :
 
Copyright © 2012. Best Online Tutorials | Source codes | Programming Languages - All Rights Reserved