DEV Community

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

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