hello i have a problem with my code.. why it doesn't work..?? is there fault with my code?
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!");
}
}
thank you