I searched everywhere but can’t find it. So I’m asking it here. I want to get the text when the mouse is on top (hover) of that text inside an html page. I tried using getClientRect, but they only give me coordinates, and not text. Does anybody know how to do this with javascript or html? Thanks.
Share
It depends on what element you’re trying to get the text for, but possibly what you want to do is use the mouseenter event.
EDIT:
How to get a word under cursor using JavaScript?
Create your HTML like this
Then something like this in jQuery.