jquery – Determining the clicked element


Hello, I need to somehow determine which element I clicked on. The element can be anything. Those. Let's say I have 5 completely different elements on the page, and I click on any of the elements and its class or some attribute is displayed to me … Also, elements can be removed or added from the page … I.e. so that no matter where I click, it still returns the element that I clicked on. And most importantly, if the element is in another element, then when you click on it, this element was returned and not its parent … It may not be clear. Feel free to ask (if you don't understand something).


$('body').click(function (event) {
Scroll to Top