Home >Web Front-end >JS Tutorial >The difference between readonly and disabled attributes_Basic knowledge
The difference between the readonly and disabled attributes of the
tag:
In form elements, readonly and disable are similar, because they can both set some form elements to the "unavailable" state. Of course, the difference between them is huge. Let's introduce these two attributes. What are the differences? I hope it can bring some help to friends in need.
List of differences between the two attributes:
1. The readonly attribute is only valid for the text box, password box and multi-line text box of the form element, while the disabled attribute is valid for all form elements.
2. The appearance of setting two attributes is different. You can observe this yourself.
3. The value of the form element set to readonly will still be submitted, but the value of the form element set to disabled will not be submitted.
The above is the difference between readonly and disabled attributes. I hope it will be helpful for everyone to learn html.