<html>
<head>
<script>
var $_text = '';
(function(){
document.onmousemove = function(){$_text = document.selection ? document.selection.createRange().text : window.getSelection(); }
document.onmouseup = function(){if($_text!='')alert($_text)}
})()
</script>
</head>
<body>
<div>hello world</div>
check this simple example out
</body>
</html>
有道 选中翻译 选中文本
最新推荐文章于 2024-03-18 09:48:38 发布