DOM props and forms

readOnly prop

Prevents user editing of supported text-like fields while allowing focus and normal submission when otherwise eligible. It differs from disabled and does not secure a value against modification by a client.

Formal Syntax & Structure

react syntaxreact
readOnly={true}

Working Example

Example Snippetreact
export default function App() { return <label>Reference<input name='reference' value='T-42' readOnly/></label>; }
React Reference