touchend event

Definition and Usage

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

Note:The touchend event is only applicable to devices with touchscreens.

Tip:Here are other events related to the touchend event:

  • touchstart - Occurs when the user touches an element
  • touchmove - Occurs when the user moves a finger on the screen
  • touchcancel - Occurs when the user moves a finger on the screen

Example

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

<p ontouchend="myFunction(event)">Touch me!</p>

Try it yourself

Syntax

In HTML:

<element ontouchend="myScript">

Try it yourself

In JavaScript:

object.ontouchend = myScript;

Try it yourself

In JavaScript, use the addEventListener() method:

object.addEventListener("touchend", myScript);

Try it yourself

Technical details

Bubbling: Supported
Cancelable: Supported
Event types: TouchEvent
Supported HTML tags: All HTML Elements

Browser Support

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

Event Chrome IE Firefox Safari Opera
touchend 22.0 12.0 52 Not Supported Not Supported