disabled vs read only difference
Though both disabled and read only primary job is preventing content being edited, still there are few differences exists between them. Below i have given differences between html disabled and readonly elements.
Disabled elements,
Example:
<input name='sample' value='test' disabled>
Read Only elements,
Example:
<input name='sample' value='test' readonly>
Disabled elements,
- Do not receive focus
- Skipped from tab navigation
- Should not be posted on form submission
Example:
<input name='sample' value='test' disabled>
Read Only elements,
- Receives the focus
- Included in tab navigation
- Values can be posted during form submission
Example:
<input name='sample' value='test' readonly>
Comments (0)