To be more clear, text fragment can be part of a sentence or a word or a phrase or whole a paragraph.
There is no "Text was selected"
(DOM) event, but you can bind a
mouseup event to the
document.body. Within that event handler, you might just check the
I'm not sure what you mean with "finding the position", but to stay in my example world you could use the
event propertys for X+Y mouse positions.