How to disable text box input in html

coldplay.xixi
Release: 2023-01-05 16:11:59
Original
7593 people have browsed it

htmlHow to disable text box input: 1. Set the input to read-only status, the code is [<input readonly="readonly" value="test1"/>]; 2. Set the input to not used Status, the code is [

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

htmlMethods to prohibit text box input:

There are two methods to prohibit text box input:

1. Set input to Read-only state, the code is as follows:

<input readonly="readonly" value="test1"/>
Copy after login

2. Set input to unused state, the code is as follows:

<input disabled="disabled" value="test2"/>
Copy after login

Two styles of HTML text field:

1. Text field without scroll bar (no border);

<textarea   style="border:   0;   overflow:   auto;   color:   #FFFFFF;   background-image:   url(http://expert.csdn.net/images/csdn.gif)"></textarea>
Copy after login

2. Text field with red border;

<textarea   style="border:   #FF0000   1px   solid;   overflow:   visible;   color:   #FFFFFF;   background-image:   url(http://expert.csdn.net/images/csdn.gif)"></textarea>
Copy after login

Related learning recommendations: html video tutorial

The above is the detailed content of How to disable text box input in html. For more information, please follow other related articles on the PHP Chinese website!

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