touchstart Event in JavaScript
touchstart Event in JavaScript
The touchstart event is used to trigger when the user touches an element. It will only work with devices that have a touch screen.
Its relative events are:-
- touchmove i.e, it occurs when the user moves the finger across the screen
- touchcancel i.e, it occurs when the touch is interrupted
- touchend i.e, it occurs when the user removes the finger from an element
Syntax:-
Its syntax is:- < element ontouchstart="my_script" > OR object.ontouchstart= function(){my_script} OR object.addEventListener("touchstart", my_script)