jQuery Mobile tap event
Example
Tap
an element and hide it:
$("p").on("tap",function(){
$(this).hide();
});
Try it »
Definition and Usage
The tap event is triggered when a user taps an element.
Tip: The tap event is similar to the jQuery click() method.
Syntax
$("
selector
").on("tap",function(event){...})
| Parameters | Description |
|---|---|
| function(event) | Required. Specifies the function to execute when the tap event is triggered. |
该函数有可选的事件对象 ,事件对象可以是任何 jQuery 事件属性 (例如 event.target, event.type, 等)。更多信息请查阅 [jQuery 事件参考手册](/jquery/jquery-ref-events.html) 。 |
More examples
Event Object
Use the event.target property to return the DOM element that triggered the tap event.
jQuery Mobile Events