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:
DisabledAll form elements can be used for attributes.
ReadonlyAttribute only<Input type = "text">, <textarea>, and <input type = "password">Valid.
2. Different Effects on elements:
DisabledAttribute prevents all operations on elements, such as getting focus and clicking events.
ReadonlyThe attribute only sets the element to read-only, and other operations are normal.
3. submit expressions:
DisabledAttribute makes the value of the form Element Unsubscribe.
ReadonlyAttribute does not affect the submission.
Original address: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 9495.