I am not thinking hard about this, so if I am way off, someone will correct
me. :P
Seems to me you would have to place just about every word (or, at least,
those you care about) in a span tag and connect to the onmouseover event or
onclick event of that span and then your handler could use scrapeText() to
get the value out.
connect(oneOfTheSpans, "onclick", function(eventArgs) {
var textClickedOn = scrapeText(eventArgs.src());
});
I don't know, there is probably some much better way of doing this, but I
thought I would at least respond.
Jason Bunting
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of Nilu
> Sent: Monday, July 07, 2008 9:11 PM
> To: MochiKit
> Subject: [mochikit] Get text under the mouse pointer via javascript
>
>
> Hi,
>
> I was wondering if it is at possible to get the word a user clicks on
> with javascript. For example if I click on "word" (note that it isn't
> inside a span, div or anchor element), the script would display
> "word".
>
> Another way of doing this would be to get the coordinates of the mouse
> and find the word which is at that point or the closest word to it.
>
> Is it possible at all? Please help
>
> cheers,
>
> Nilu
>
> >
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com
> Version: 8.0.138 / Virus Database: 270.4.6/1540 - Release Date: 7/8/2008
> 6:33 AM
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---