How to make input non-editable in css

coldplay.xixi
Release: 2023-01-03 09:29:37
Original
2913 people have browsed it

Css method to make input uneditable: 1. Set [onfocus=this.blur()] to leave the focus when the mouse cannot be placed; 2. Set disabled, the code is [<..name=" input1" value="()" disabled="true">].

How to make input non-editable in css

The operating environment of this tutorial: windows7 system, css3 version, DELL G3 computer.

Css method to make input non-editable:

Method 1: onfocus=this.blur() Leave the focus when the mouse cannot be placed

<input type="text" name="input1" value="()" onfocus=this.blur()>
Copy after login

Method 2: readonly

<input type="text" name="input1" value="()" readonly> <input type="text" name="input1" value="中国" readonly="true">
Copy after login

Method 3: disabled

<input type="text" name="input1" value="()" disabled="true">
Copy after login

Extended information:

Grammar Input (number, [#]filenumber) The syntax of the Input function has the following Part: Part description number is required. Any valid numeric expression specifying the number of characters to return. filenumber is required. Any valid file number. Note: Print # or Put is usually used to write the data read by the Input function into a file.

The Input function is only used for files opened in Input or Binary mode. Unlike the Input # statement, the Input function returns all characters it reads, including commas, carriage returns, blank columns, newlines, quotation marks, leading spaces, etc. For files opened with Binary access type, if you try to read the entire file using the Input function, an error will occur when EOF returns True.

Related tutorial recommendations: CSS video tutorial

The above is the detailed content of How to make input non-editable in css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
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