Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
823 views
in Technique[技术] by (71.8m points)

javascript - Getting the text under the mouse pointer

I'm writing a browser add-on and want to get the word / words the user is currently hovering over via Javascript.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There's no good general purpose function to do that. If you specify which browser you're adding on to, there might be a specific workaround. When faced with this problem in the past, I had to resort to asking the user to double-click the word (then you can detect the double-click, get selection, and reset it back).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...