jQuery Mobile tapEvent

jQuery Mobile 事件jQuery Mobile Events

Examples

Tap the <p> element and hide it:

$("p").on("tap",function(){
  $(this).hide();
});

Try it yourself »

Definition and Usage

The tap event triggers when the user taps an element.

Tip:The tap event is similar to the jQuery click() method.


Syntax

$("selector").on("tap",function(event){...})

Parameter Description
function(event) Required. Specifies the function to execute when the tap event is triggered.

The function has an optional event object, which can be any jQuery event property (e.g., event.target, event.type, etc.). For more information, seejQuery Event Reference Manual 。


实例

More Examples

Event Object
Use the event.target property to return the DOM element that triggered the tap event.


jQuery Mobile 事件jQuery Mobile Events

Other Extensions