VOOZH about

URL: https://www.geeksforgeeks.org/html/html-textarea-readonly-attribute/

⇱ HTML <textarea> readonly Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML <textarea> readonly Attribute

Last Updated : 11 Jul, 2025

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."

Output:

👁 html-textarea-readonly-attribute-example

Example 2: In This HTML example demonstrates the use of the readonly attribute in a <textarea> tag, creating a non-editable textarea with the specified content.

Output:

👁 html-textarea-readonly-attribute-example-2
HTML textarea read only attribute
Supported Browsers

The browser supported by <textarea> readonly attribute are listed below: 

Comment
Article Tags: