如何从文本框中删除光标? [英] How to remove cursor from text box?

查看:53
本文介绍了如何从文本框中删除光标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:

<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?

推荐答案

如果在 元素,则可以使用 caret-color CSS属性插入符 透明 :

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>

这篇关于如何从文本框中删除光标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆