readonly attribute on <textarea>

Return to main list

The boolean readonly attribute makes the element not mutable (not changable), meaning the user can not edit the control. The difference between disabled and readonly is that read-only controls can still function, whereas disabled controls generally do not function as controls until they are enabled.

Example with readonly

Example without readonly

Code

<div class="form-group">
  <label for="aaa">Comment</label>
  <textarea id="aaa" readonly="readonly" rows="5">
    Hello
  </textarea>
</div>

<div class="form-group">
  <label for="bbb">Comment</label>
  <textarea id="bbb" rows="5">
    Hello
  </textarea>
</div>

Assistive technologies

VoiceOver

NVDA

JAWS

Return to main list