DEV Community

Discussion on: Rethinking JavaScript: The complete elimination and eradication of JavaScript's this.

zeddotes profile image

Actually, jQuery calls the callback of the element's this passed into it via apply and call. Check it out:

Thread Thread
benwick profile image

In jquerys events this is the same as event.delegateTarget:

So you can use the arrow function to get access to the parent context and still access the element you have attached the listener to... Please don't stop using this just because you don't know how a lib works.

$('p').on('click', (evt) => {
Enter fullscreen mode Exit fullscreen mode