Skip to content
Advertisement

How to get the element on which taphold is fired?

Can you please help me to locate on which element “taphold” is fired by using JS, jQuery, or jQuery Mobile?

My HTML structure is like the below

JavaScript
JavaScript

In my JavaScript code I am able to prevent the default behavior of taphold, but I am not getting how to get the Id of a particular list as soon as a user tap and hold on that list.

Advertisement

Answer

You can bind the taphold to the li elements instead of the listview:

JavaScript

DEMO

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement