Input tag implementation so that the cursor does not appear !, Input tag implementation cursor
Recently, I encountered a very worried problem. When I used the input label, I didn't want the cursor to appear, because the input content is given by the system and won't be changed by users.
Someone may say that it is a good choice to directly use div to simulate an input. However, unfortunately, my conditions do not allow me to simulate, input is required!
At this time, I naturally thought of the readOnly attribute of the input tag. After setting it, I found that the content cannot be changed when I click it, but there is a small cursor. If I don't have this cursor, it will be perfect.
So I naturally thought of the disabled attribute. Oh, well, it looks good. It's good on chrome, FF, IE9 and later browsers, however, in IE 8 and earlier browsers, the font is dimmed by default ~~ Internet Explorer !!
Finally, I found a solution on a foreign Forum. The tag still had this attribute: unselectable, which is a omnipotent html!
After testing, you can prevent the cursor from appearing according to the following settings. The example is as follows:
<Input class = "red" readonlyunselectable = "on" value = "I said I am red">
<Style>
Input. red {
Color: # f00;
}