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

Solution to Apache cross-domain resource access error

In many cases, large and medium-sized websites wi...

HTML tags list and usage instructions

List of HTML tags mark type Name or meaning effec...

Introduction to installing and configuring JDK under CentOS system

Table of contents Preface Check and uninstall Ope...

A brief analysis of the differences between undo, redo and binlog in MySQL

Table of contents Preface 【undo log】 【redo log】 【...

Brief analysis of mysql scheduled backup tasks

Introduction In a production environment, in orde...

HTML table markup tutorial (37): background image attribute BACKGROUND

Set the background image for the table header. Yo...

In-depth understanding of the use of the infer keyword in typescript

Table of contents infer Case: Deepen your underst...

Detailed explanation of formatting numbers in MySQL

Recently, due to work needs, I need to format num...

Two ways to manage volumes in Docker

In the previous article, I introduced the basic k...

MySQL query sorting and paging related

Overview It is usually not what we want to presen...

How to successfully retrieve VMware Esxi root password after forgetting it

Prepare a CentOS6 installation disk (any version)...