Skip to main content
1 de 2

Bind clicking element based on class

I am trying to obtain what is the item I am clicking, but no idea on how to proceed. This is the specific case:

Html schema:

<div class="item>
  <div class="front"></div>
  <div class="back"></div>
</div>
<div class="item>
  <div class="front"></div>
  <div class="back"></div>
</div>
<div class="item>
  <div class="front"></div>
  <div class="back"></div>
</div>
...

I am binding when an item is clicked with the following JQuery code:

$('.item').on('click', (event) => {
      //How I can bind here the element?¿
      myElement.animate({...}, 5000, function() {...});
});