Click to See Complete Forum and Search --> : detecting highlighted text??


mitya
02-25-2004, 06:58 AM
Hi

Is there a way to detect the text highlighted on a page? i.e. if you clicked and dragged over a word, thus highlighting it, could javascript detect what had been highlighted?

Thanks in advance.

gil davis
02-25-2004, 07:04 AM
Yes.
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_selection.asp

mitya
02-25-2004, 10:58 AM
Thanks for that, BUT I'm struggling. I have to confess the jargon used on MSDN is something I'm still getting used to as I'm new to JS, but I can see that somewhere it's what I'm after. I read around on the site quite extensively, but either found myself on bits that weren't relevant or simply didn't make sense. Moreover, there are very few clearly explained examples.

Which bit should I be looking at to, say, alert the value of the currently-highlighted text?

Thanks again.