Latest web development tutorials

jQuery Mobile tap event

jQuery Mobile Events jQuery Mobile Events

Examples

Tap <p> element and hide it:

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

try it"

Definition and Usage

tap event is triggered when users tap an element.

Tip: tap an event similar to jQuery click () method.


grammar

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

参数 描述
function(event) 必须。指定 tap 事件触发时执行的函数。

该函数有可选的事件对象 ,事件对象可以是任何 jQuery 事件属性 (例如 event.target, event.type, 等)。更多信息请查阅 jQuery 事件参考手册


Examples

More examples

Event objects
Use event.target property to return the DOM element tap event trigger.


jQuery Mobile Events jQuery Mobile Events