What is the difference between disabled and readonly in HTML?

php中世界最好的语言
Release: 2018-01-26 10:38:37
Original
2346 people have browsed it

This time I will show you the difference between disabled and readonly in HTML? , what are the precautions when using disabled and readonly in HTML? The following is a practical case, let’s take a look.

1: readonly is to lock this control, and it cannot be modified through the interface (but it can be modified through javascript).

2: Disabled and readonly are similar in that they can lock the control and users cannot change its value, but disabled is more thorough. It means that you cannot use it at all, including changing its background color. (If you don’t believe it, if you try to modify a disabled input text box, you will find that your efforts are in vain). If it is a checkbox, you cannot select it.

3: All controls have the disabled attribute, but they do not necessarily have the readonly attribute. For example, select the drop-down box

I believe you have mastered the method after reading these cases. For more exciting information, please pay attention to the php Chinese website Other related articles!

Related reading:

How to use the head structure in HTML

Important attributes compatible with IE8X-UA- Compatible

In HTML lists, what are the differences between dl(dt,dd), ul(li), and ol(li)

The above is the detailed content of What is the difference between disabled and readonly in HTML?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template