readonly attribute on <input>

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">Full name</label>
  <input id="aaa" type="text" value="Hello" readonly="readonly">
</div>

<div class="form-group">
  <label for="bbb">Full name</label>
  <input id="bbb" type="text" value="Hello">
</div>

Assistive technologies

VoiceOver

NVDA

JAWS

Return to main list