views:

159

answers:

0

Hi, i'm trying to find a clicked word in an onclick event handler.

somediv.onclick = function(event) {
    var w  = getClickedWord(event);
    alert(w)
}

getClickedWord() uses range.moveToPoint for msie and event.rangeParent/offset for gecko, but Webkit seems to support neither. Any pointers?