If I have the following html structure:
<div class ='wrapper'></div>
<div class ='wrapper'></div>
I want to get this element
<div class ='wrapper'></div>
I tried doing something like this:
$(document).on('click', 'wrapper', ()=>{
var element = $(this); //not sure how to do this
});
How can I get a reference to the clicked element so I can used it for things like $(element).siblings()
and next()
, etc.
The method that I tried to use, selects all the elements with that class, i want to get only the element clicked on, Is there a way I can do that ?