function showIt(obj)
{
var con = ['你好','世界','You','Good'];
var reg = /\d+/;
var id = obj.id.match(reg);
var t = document.getElementById("con");
t.innerText = con[parseInt(id)];
}
function hiddenIt()
{
document.getElementById('con').visibility='hidden';
}
function mouseMove()
{
var t = document.getElementById("con");
t.style.left = event.x-5;
t.style.top = event.y-8;
}
</script>
</HEAD>
<body onmousemove="mouseMoveToSelectFun(this)" >
Ctrl + 鼠标 = 选中<br>
<br>
Would you like bananas ?<br>
Would you like bananas ?<br>
Would you like bananas ?<br>
</body>
</html>
<script language=javascript>
function mouseMoveToSelectFun(obj)
{
var theRange=obj.createTextRange();
theRange.moveToPoint(event.x,event.y);
theRange.expand("word");
theRange.select();
}
<body onmousemove="mouseMoveToSelectFun(this)" >
Ctrl + 鼠标 = 选中<br>
<br>
Would you like bananas ?<br>
Would you like bananas ?<br>
Would you like bananas ?<br>
</body>
</html>
<script language=javascript>
function mouseMoveToSelectFun(obj)
{
if(!event.ctrlKey) return false;
var theRange=obj.createTextRange();
theRange.moveToPoint(event.x,event.y);
theRange.moveStart("word",-1);
theRange.moveEnd("word",1);
theRange.select();
}