Disable input text box input implementation properties

Disable input text box input implementation properties
Today I want to summarize several very useful HTML tags, which are often used in development. People who are not familiar with them may not know them very well. They are:

Copy code
The code is as follows:

readonly, disabled, autocomplete

readonly means that the value of this field cannot be modified. It can only be used with type="text". It can be copied, selected, and receive focus. The background will receive the value.

Copy code
The code is as follows:

<input type="text" name="www.xxx" readonly="readonly" />

disabled means the input element is disabled. It cannot be edited, copied, selected, or receive focus. The background will not receive the value.

Copy code
The code is as follows:

<input type="text" name="www.xxx.com" disabled="disabled" />

You can also block the input method through CSS: <input style="ime-mode: disabled">
Finally, let me introduce a commonly used tag. The browser usually records the input box, so when you enter, you often drop down a lot of content, as shown below:
If you want to remove it, it is best to add autocomplete="off", the usage is as follows: autocomplete="off"

Copy code
The code is as follows:

<input type="text" autocomplete="off" id="number"/>

<<:  UCenter Home site adds statistics code

>>:  Solve the problem of Navicat for MySQL reporting 2005 error when connecting to MySQL

Recommend

Implementation of TCPWrappers access control in Centos

1. TCP Wrappers Overview TCP Wrappers "wraps...

Understand the principle of page replacement algorithm through code examples

Page replacement algorithm: The essence is to mak...

Example of writing mobile H5 to invoke APP (IOS, Android)

iOS 1. URL scheme This solution is basically for ...

A Preliminary Study on JSBridge in Javascript

Table of contents The origin of JSBridge The bidi...

MySQL query specifies that the field is not a number and comma sql

Core SQL statements MySQL query statement that do...

...

15 Best Practices for HTML Beginners

Here are 30 best practices for HTML beginners. 1....

Vue2 cube-ui time selector detailed explanation

Table of contents Preface 1. Demand and Effect ne...

Zen coding for editplus example code description

For example, he enters: XML/HTML Code div#page>...

Example code for implementing ellipse trajectory rotation using CSS3

Recently, the following effects need to be achiev...

Four categories of CSS selectors: basic, combination, attribute, pseudo-class

What is a selector? The role of the selector is t...

Linux service monitoring and operation and maintenance

Table of contents 1. Install the psutil package S...

How to build gitlab on centos6

Preface The original project was placed on the pu...

Eight common SQL usage examples in MySQL

Preface MySQL continued to maintain its strong gr...