Readonly and Disabled are two attributes used in forms. They both prevent users from changing the content of form fields. But there are slight differences between them, which are summarized as follows:
Readonly is only valid for input (text / password) and textarea, while disabled is valid for all form elements, including select, radio, checkbox, button, etc. . However, after the form element is disabled, when we submit the form by POST or GET, the value of this element will not be passed out, and readonly will pass the value out (this situation occurs when we submit a certain The textarea element in the form is set to disabled or readonly, but the submit button can be used).
Example