Sometimes, we want the text boxes in the form to be read-only so that users cannot modify the information in them, such as making the content of <input type="text" name="input1" value="中国">, the word "中国" cannot be modified. To summarize, there are several ways to implement it. Method 1: onfocus=this.blur() will lose focus when the mouse cannot be placed <input type="text" name="input1" value="中国" onfocus=this.blur()> Method 2: readonly <input type="text" name="input1" value="中国" readonly> <input type="text" name="input1" value="中国" readonly="true"> Method 3: disabled <input type="text" name="input1" value="中国" disabled="true"> Complete example: <input name="ly_qq" type="text" tabindex="2" onMouseOver="this.className='input_1'" onMouseOut="this.className='input_2'" value="123456789" disabled="true" readOnly="true" /> disabled="true" If this option is enabled, the text will become gray and cannot be edited. readOnly="true" text will not change color and is not editable CSS shielding input: <input style="ime-mode: disabled"> There are two methods: First: disabled="disabled". After this definition, the disabled input element is neither available nor clickable. Second: readonly="readonly" read-only fields cannot be modified. However, users can still use the tab key to switch to the field, and can select or copy its text; |
<<: TortoiseSvn Little Turtle Installation Latest Detailed Graphics Tutorial
>>: Design Theory: Hierarchy in Design
Pull the image docker pull mysql View the complet...
Adding the attribute selected = "selected&quo...
Table of contents Summarize Summarize When the ar...
Table of contents 1. Traversal Class 1. forEach 2...
In this post, we’ll use the :placeholder-shown ps...
In previous blog posts, I have been focusing on so...
Table of contents 1. Introduction: In this case, ...
It is mainly the configuration jump of the if jud...
Related reading: Solve the problem that the servi...
Table of contents 1. What is the use of provide/i...
Seurat is a heavyweight R package for single-cell...
Table of contents Overview CommonJS Specification...
Dimensionality reduction of two-dimensional array...
Table of contents Precautions Necessary condition...
This article introduces the method of implementin...