My assumption is that you cannot do this if each word is not in its own container, for example, etc., and you have declared an onmouseover handler for this. A simpler approach is to use the currentSelection element when the user double-clicks or selects a piece of text in the browser. To do this, you can write on mouse click / double click events.
source
share