In the text box, the browser does not make any special mark on it in the read-only and normal status. On the surface, the effect is the same. In this way, for users, ease of use is not very high.
Of course, we can change the background color of the read-only text box to distinguish between them.ProgramThe member determines whether the text box is read-only and then introduces the corresponding CSS, which undoubtedly increases the workload.
Here, expression is used to provide a solution. You only need to introduce this CSS to each page. The program determines the other items as follows:
<Style>
Input {background-color: expression (this. readonly & this. readonly = true )? "# F0f0f0 ":"")}
</Style>
<Input type = "text" name = "">
<Input type = "text" name = "" readonly>
<Input type = "text" name = "">
<Input type = "text" name = "" readonly>