Event listener to a class, which element was triggered?

Hello…

Needing to fix a pre-made template mobile bug, I want to capture touch events and convert them to clicks.

I had to add a script which does something like this…


// assign event listener to elements of .myclass
jQuery('.myclass').on('touchstart', function(e) {

   jQuery('.myclass').trigger('click'); // convert touch event to a click

});

The problem is, I don’t think the event I want to trigger (the click) gets triggered in the intended element (where the touchstart happened).

Any ideas about this?

Thanks in advance

// assign event listener to elements of .myclass
jQuery('.myclass').on('touchstart', function(e) { 
  
   jQuery([COLOR="#FF0000"]e.target[/COLOR]).trigger('click'); // convert touch event to a click

});

That was it, thank you!