get word under cursor?

T

Timo

Assume we have this html:

<span>the quick brown fox</span>

and the mouse is hovering over the word "fox". Using javascript, is it
possible to determine the word under the mouse *without* introducing
additional elements such as an anchor?

//undesirable:
<span>the quick brown <a id='fox'>fox</a></span>

Thanks
Timo
 
D

Dietmar Meier

Timo said:
<span>the quick brown fox</span>

and the mouse is hovering over the word "fox". Using javascript, is it
possible to determine the word under the mouse *without* introducing
additional elements

No. The browser doesn't know about words. In the browser's object model,
the text node "the quick brown fox" is atomic.

ciao, dhgm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top