readonly
The readonly boolean attribute prevents the user from editing a control while still submitting its value.
Syntax
readonly Examples
<input type="text" name="invoice" value="INV-2026-001" readonly>
Output
Renders an uneditable but selectable and submittable field showing the invoice number.
Notes
Unlike disabled, a readonly control is still focusable, copyable, and submitted with the form. It applies only to text-like inputs and textarea, not checkboxes, radios, or selects.
Browser & runtime support
| Environment | Since version |
|---|---|
| chrome | 1.0 |
| firefox | 1.0 |
| safari | 1.0 |
| edge | 12 |