Last active
August 29, 2015 14:22
-
-
Save folmert/7115a8fe286ee671804c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment