jQuery is currently providing me with a fun introduction to Javascript after 12 years of surviving happily without. I\'m at the stage where I\'m trying to learn as much as I
this
and event.target
are not always the same.
this
refers to the element you assigned the listener to ( in this case the '#a_button' ). event.target
however is the element that actualy triggered the event, which can be a childnode of #a_button
.
So $(this)
is the thing you are looking for.
See reference: http://api.jquery.com/event.target/