readonly

The readonly boolean attribute prevents the user from editing a control while still submitting its value.

Since HTML 2.0 Spec ↗

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

EnvironmentSince version
chrome 1.0
firefox 1.0
safari 1.0
edge 12

See also