The event object gives the target property, which refers to the actual click of the element, and the currentTarget property, which refers to the element to which the handler is bound.
These elements are represented as DOM nodes, which are simply objects with their own properties that allow you to access some aspects of the state of an element.
$(window).click(function(e) { alert(e.target.id);
user1106925
source share