Alex Rivera | Logout

Selected text event trigger in Javascript

Asked 2010-08-23T05:48:49.627
96

How to trigger a JavaScript function when someone selects a given text fragment on a page using mouse?
Also, is there any way to find the position of selected text on the page?

Update: To be more clear, text fragment can be part of a sentence or a word or a phrase or whole a paragraph.

Edit
Report

1 Answer

1

AFAIK, there is no such event you described. But you can emulate that function.

Look over here for the code and demo.

answered 2010-08-23T06:18:06.887

Your Answer