To prevent users from typing in a text field without disabling the field with HTML, we add the readonly
attribute.
For instance, we write
<input readonly type="text" />
to add the readonly
attribute to the input to stop users from enter input values but not make it grayed out.