jquery – 使用.select()取消选择输入中选择的内容

在我使用.select()选择输入框中的文本时,我执行以下操作:

HTML

<input type="text" class="hoverAble" value="hover here"/><br />

jQuery的:

$(".hoverAble").mouseenter(function() {

    this.select();

}).mouseleave(function() {

    //I can't figure what to put here.
});

here.
警告它正常运行(在jsfiddle中)你必须在结果框中单击一次.

主要思想是mouseleave也作为as expected工作.

正如您可能已经注意到的那样,当您将鼠标悬停时我无法找到取消选择文本的方法并避免这种情况:

解决方法

相关文章

jQuery表单验证提交:前台验证一(图文+视频)
jQuery表单验证提交:前台验证二(图文+视频)
jQuery如何实时监听获取input输入框的值
JQuery怎么判断元素是否存在
jQuery如何实现定时重定向
jquery如何获取复选框选中的值