How to get the link being right clicked/being hovered on


In my plugin how may I get the text/uri/url of the link the user right clicks or hovers on. And how may I find such information on my own? I am new to web developpement and javascript.

Thank you very much!