хром
<input value="select some text">
<div style="position: absolute; display: none; background: lightgrey; color: green"</div>
<script>
document.body.children[0].onmousedown = function () {
this.onmousemove = function (e) {
e = e || event;
this.nextElementSibling.innerHTML = document.getSelection();
var hint = this.nextElementSibling;
hint.style.display = 'block';
hint.style.left = e.clientX + 'px';
hint.style.top = e.clientY + 10 + 'px';
}
this.onmouseout = function () {
this.nextElementSibling.style.display = 'none';
this.onmouseout = null;
this.onmousemove = null;
}
this.onmouseup = function () {
this.nextElementSibling.style.display = 'none';
this.onmouseup = null;
this.onmousemove = null;
}
}
</script>