I want to know the clear difference between delegateTarget and currentTarget keys of jQuery event object.
$(this).on('click',function(event){
console.log(event.delegateTarget);
console.log(event.currentTarget);
})
both are looking very similar
which one should use?
thanks 🙂
You will notice a difference when using event delegation.
Here’s a better example to illustrate
See http://jsfiddle.net/PRcte/1/ and http://api.jquery.com/on/#direct-and-delegated-events