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

HTML uses regular expressions to test table examples

Here is an example code for using regular express...

Case analysis of several MySQL update operations

Table of contents Case Study Update account balan...

Analysis of Mysql data migration methods and tools

This article mainly introduces the analysis of My...

Tutorial on installing MySQL8 compressed package version on Win10

1 Download MySQL8 from the official website and i...

VMware Workstation download and installation detailed tutorial

Virtual machines are very convenient testing soft...

How to install Docker using scripts under Linux Centos

What is the main function of Docker? At present, ...

Practice using Golang to play with Docker API

Table of contents Installing the SDK Managing loc...

CSS3 uses var() and calc() functions to achieve animation effects

Preview knowledge points. Animation Frames Backgr...

How to prohibit vsftpd users from logging in through ssh

Preface vsftp is an easy-to-use and secure ftp se...

Web page experience: planning and design

1. Clarify the design direction <br />First,...

How to use a field in one table to update a field in another table in MySQL

1. Modify 1 column update student s, city c set s...

JavaScript to achieve elastic navigation effect

This article shares the specific code for JavaScr...