touchcancel Event in JavaScript
touchcancel Event in JavaScript
The touchcancel event is used to trigger when touch event gets interrupted. It is used for cleaning up code if different devices interrupts touch event at different actions and it results in an error. It will only work with devices that have a touch screens.
Its relative events are:-
- touchstart i.e, it occurs when the user touches an element
- touchend i.e, it occurs when the user removes the finger from an element
- touchmove i.e, it occurs when the user moves the finger across the screen
Syntax:-
Its syntax is:- < element ontouchcancel="my_script" > OR object.ontouchcancel= function(){my_script} OR object.addEventListener("touchcancel", my_script)