Here is my code:
<table>
<tr>
<td><input type="text" value="test1" readonly /></td>
</tr>
<tr>
<td><input type="text" value="test2" readonly /></td>
</tr>
<tr>
<td><input type="text" value="test3" readonly /></td>
</tr>
</table>
How do I remove the cursor from the text box?
If the browser shows the insertion caret when the readonly
attribute is set on an input[type="text"]
element, you may be able to use the caret-color
CSS property to make the caret transparent
:
.caret-hidden {
caret-color: transparent;
}
<input class="caret-hidden" type="text" readonly>
Poor man's solution: transmit value in a hidden form item (<input type="hidden">
) and display it in a regular HTML container (<p></p>
, <div></div>
or whatever).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With