What is the difference between disabled and readonly ?, Disabledreadonly
I saw such an article in my blog that the difference between disabled and readonly was not noticed before. It is necessary to know the difference between them, so I reprinted it.
These two attributes are similar, but the difference is huge. The reason for this is that both attributes seem to be able to set the specified element to the "unavailable" state, the following is a brief introduction of the differences between them, hoping to help you.
I. Different functions:
Disabled
All form elements can be used for attributes.
Readonly
Attribute only<Input type = "text">, <textarea>, and <input type = "password">
Valid.
2. Different Effects on elements:
Disabled
Attribute prevents all operations on elements, such as getting focus and clicking events.
Readonly
The attribute only sets the element to read-only, and other operations are normal.
3. submit expressions:
Disabled
Attribute makes the value of the form Element Unsubscribe.
Readonly
Attribute does not affect the submission.
Original address: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 9495.