touchend Event
THE WORLD'S LARGEST WEB DEVELOPER SITE

touchend Event

❮ DOM Events ❮ TouchEvent

Example

Execute a JavaScript when the user releases the touch (for touch screens only):

<p ontouchend="myFunction(event)">Touch me!</p>
Try it Yourself »

Definition and Usage

The touchend event occurs when the user removes the finger from an element.

Note: The touchend event will only work on devices with a touch screen.

Tip: Other events related to the touchend event are:

  • touchstart - occurs when the user touches an element
  • touchmove - occurs when the user moves the finger across the screen
  • touchcancel - occurs when the touch is interrupted

Browser Support

The numbers in the table specify the first browser version that fully supports the event.

Event
touchend 22.0 12.0 52 Not supported Not supported


Syntax

In HTML:

<element ontouchend="myScript">
Try it Yourself »

In JavaScript:

object.ontouchend = myScript;
Try it Yourself »

In JavaScript, using the addEventListener() method:

object.addEventListener("touchend", myScript);
Try it Yourself »

Technical Details

Bubbles: Yes
Cancelable: Yes
Event type: TouchEvent
Supported HTML tags: All HTML elements

❮ DOM Events ❮ TouchEvent