Hi folks:
I'm working on a site for writers, and am trying to figure out a way to know the characters/words selected by a user. I'm not sure whether to include this in the javascript forum or the css forum...
For instance, say someone is reading a page in a story online in a browser (NOT inside a textarea control, though if it's possible there, then great. I'm talking just clicking and selecting part of a web page. They click the mouse over a character, drag the mouse until a whole word is selected, and then mouseup. A word (or phrase) has just been selected, and I'd like to do some ajax-type things w/that selection. This has to be multi-browser, though I don't care about older browsers too much, and fahgedabout Mac IE 5.2.3 ;-)
Does anyone have any idea if this is possible, and if so, how to do it? I know I can track a mousedown and mouse up event...but I've never seen any event that tracks a selection, though, of course, each browser has a 'cut/copy' capability, so the functionality is there *somewhere*. Thanks for any help. I've got a bald spot trying to figure this thing out.



Reply With Quote

Bookmarks