if( e.target === this ) { return "clicked element is parent"; } else { return "clicked element is child" } // "this" always refers to the DOM element the listener was attached to, // event.target is the actual DOM element that was clicked.