HTML DOM Textarea disabled Property

The HTML DOM Textarea disabled property returns and modify whether the text area element in an HTML document is disabled or not.


Following is the syntax −

1. Returning disabled


2. Adding disabled

object.disabled = true | false

Let us see an example of HTML DOM Textarea disabled Property:


Live Demo

<!DOCTYPE html>
   body {
      color: #000;
      background: lightseagreen;
      height: 100vh;
   .btn {
      background: #db133a;
      border: none;
      height: 2rem;
      border-radius: 2px;
      width: 40%;
      display: block;
      color: #fff;
      outline: none;
      cursor: pointer;
<h1>DOM Textarea disabled Property Demo</h1>
<textarea placeholder="Hi! I'm placeholder text of a textarea element" rows="8" cols='20'></textarea>
<button onclick="set()" class="btn">Disable Textarea</button>
   function set() {
      document.querySelector("textarea").disabled = true;


Click on “Disable Textarea” button to disabled the textarea element.