Horje

How to add HTML <textarea> readonly Attribute with label Tag

A read-only text area.

Definition and Usage

The readonly attribute is a boolean attribute.

When present, it 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, highlight it and copy 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

Syntax

<textarea readonly>

index.html
Example: HTML
<label for="text">Type</label><br>
<textarea rows="4" cols="50" readonly>
At horje.com you will learn how to make a website. We offer free tutorials in all web development technologies.
</textarea>

Output should be:

How to add HTML <textarea> readonly Attribute with label Tag




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Tag
Uploaded by:
Admin