X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

jQuery tap Event

jQuery Mobile Events jQuery Mobile Events

Example

Tap on a <p> element to hide it:

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

Try it yourself »

Definition and Usage

The tap event is triggered when the user taps on an element.

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


Syntax

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

Parameter Description
function(event) Required. Specifies the function to run when the tap event occurs.

The function has an optional event object, which can contain any jQuery event properties (e.g. event.target, event.type, etc.) See jQuery Events Reference for more information.


Examples

Try it Yourself - Examples

The event object
Using the event.target property to return which DOM element that triggered the tap event.


jQuery Mobile Events jQuery Mobile Events


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook