PDA

View Full Version : Is there a way to track characters selected via/mousedown/mouseup?



aaava
08-17-2005, 06:48 PM
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. For instance, say someone is reading a page in a story. 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.