How to get DOM object which I clicked onto?

How could I to do it when I want to obtain any object in DOM where I clicked. E.g. if I clicked on image, I would like to get this object. And can I distinguish whether I used left mouse button or right mouse button?

I do not plan to use id of the element because I don’t know it. I would like to inject script into page so I can inspect the parent elements of the object.

A click event has a target property and a button property.

Thank you