Home >Web Front-end >JS Tutorial >The difference between readonly and disabled attributes_Basic knowledge

The difference between readonly and disabled attributes_Basic knowledge

WBOY
WBOYOriginal
2016-05-16 15:48:581170browse

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn