Created
January 3, 2013 13:13
-
-
Save philsinatra/4443377 to your computer and use it in GitHub Desktop.
In jQuery event.target always refers to the element that triggered the event, where ‘event’ is the parameter passes to the function. http://docs.jquery.com/Events_(Guide)
This file contains 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
$(document).ready(function() { | |
$("a").click(function(event) { | |
alert(event.target.id); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment