你好我的代码有问题..为什么它不起作用..?? 我的代码有问题吗?
function selectWord() {
var select = window.getSelection();
if (select.getBoundingClientRect) {
var rect = select.getBoundingClientRect ();
x = rect.left;
y = rect.top;
w = rect.right - rect.left;
h = rect.bottom - rect.top;
alert (" Left: " + x + "\n Top: " + y + "\n Width: " + w + "\n Height: " + h);
}
else {
alert ("Your browser does not support!");
}
}
谢谢你