HTMLTextAreaElement: disabled property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{ APIRef("HTML DOM") }}
The **disabled** property of the {{DOMxRef("HTMLTextAreaElement")}} interface indicates whether this multi-line text control is disabled and cannot be interacted with. It reflects the {{htmlelement("textarea")}} element's [disabled](/en-US/docs/Web/HTML/Reference/Elements/textarea#autocomplete) attribute. When false, this textarea may still be disabled if its containing element, such as a {{htmlelement("fieldset")}}, is disabled.
Value
A boolean.
Examples
js
const textareaElement = document.getElementById("comment");
if (commentsDisabled) {
textareaElement.disabled = true;
}Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- {{HTMLElement("textarea")}}
- {{DOMXref("HTMLTextAreaElement.readOnly")}}