touchend Event
Example
Call a function when the user releases the touch (for touch screens only):
<p ontouchend="myFunction(event)">Touch me!</p>
Try it Yourself »
Description
The touchend event occurs when a user removes the finger from an element.
The touchend event only works on touch screens.
Touch Events
| Event | Occurs When |
|---|---|
| touchstart | The user touches an element |
| touchmove | The user moves the finger across the screen |
| touchend | The user removes the finger from an element |
| touchcancel | The touch is interrupted |
Events that are triggered from the user interface belongs to the UiEvent Object.
UiEvent Properties
| Property | Description |
|---|---|
| detail | A number with details about the event |
| view | A reference to the Window object where the event occurred |
See Also:
Syntax
In JavaScript, using the addEventListener() method:
object.addEventListener("touchend", myScript);
Try it Yourself »
Technical Details
| Bubbles: | Yes |
|---|---|
| Cancelable: | Yes |
| Event type: | TouchEvent |
| HTML tags: | All HTML elements |
Browser Support
ontouchend is a DOM Level 4 (2015) feature.
It is supported in all modern browsers:
| Chrome | Edge | Firefox | Safari | Opera |
| Yes | Yes | Yes | Yes | Yes |