Textarea readOnly attribute

Definition and Usage

readOnly Attribute sets or returns whether the content of the text area should be read-only.

In a read-only text area, the content cannot be changed, but users can use the Tab key to switch to the area, or highlight and copy the content from it.

This attribute reflects the HTML readonly attribute.

Tip:To prevent users from interacting with the text area, use disabled Attribute.

Example

Example 1

Set text area to read-only:

document.getElementById("myTextarea").readOnly = true;

Try it yourself

Example 2

Check if the text area is read-only:

var x = document.getElementById("myTextarea").readOnly;

Try it yourself

Syntax

return readOnly attribute:

textareaObject.readOnly

set readOnly attribute:

textareaObject.readOnly = true|false

প্রতিভাত্ত্ব মান

মান বর্ণনা
true|false

টেক্সট এলাকা কি অবলুপ্ত হওয়া উচিত বলে নির্দিষ্ট করুন

  • true - টেক্সট এলাকা অবলুপ্ত
  • false - ডিফল্ট।টেক্সট এলাকা পরিবর্তনযোগ্য

প্রযুক্তিগত বিবরণ

ফিরিয়ে দেওয়া মান: বুল মান, যদি টেক্সট এলাকা অবলুপ্ত হয়, তবে ফিরিয়ে দেওয়া হবে true;অন্যথায় ফিরিয়ে দেওয়া হবে false

ব্রাউজার সমর্থন

চ্রোম এডজ ফায়ারফক্স স্যাফারি ওপেরা
চ্রোম এডজ ফায়ারফক্স স্যাফারি ওপেরা
সমর্থন সমর্থন সমর্থন সমর্থন সমর্থন