Back to Content

HTMLTextAreaElement: disabled property

files/en-us/web/api/htmltextareaelement/disabled/index.md

latest801 B
Original Source

{{ 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 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")}}