HTML <textarea> readonly Attribute prevents user input, making the textarea content read-only, allowing only the display of text without editing capability.
Syntax:
<textarea readonly> Contents... </textarea>
HTML <textarea> Readonly Attribute Examples
Example 1: In this example we use the readonly attribute within a <textarea> tag, creating an uneditable textarea field displaying the text "This textarea field is readonly."
<!DOCTYPE html>
<html>
<head>
<title>
HTML Textarea readonly Attribute
</title>
</head>
<body style="text-align:center">
<p>A readonly Textarea.</p>
<!--A readonly Textarea-->
<textarea readonly>
This textarea field is readonly.
</textarea>
</body>
</html>