event.currentTarget vs. this
You can use event.currentTarget
in place of this
inside jQuery event handlers
$('.button').on( 'click', function( event ) {
console.log( event.currentTarget === this ); // true
});
While this
inside event handlers has become commonplace, I feel the event.currentTarget
pattern is more obvious. It is more compatible working with other patterns that use this
differently.