How to implement an onmousedown and onmouseup on an iPhone touch screen
Solution 1:
The equivalent for onmousedown
on touchscreen devices is ontouchstart
, and the equivalent of onmouseup
is ontouchend
.
If you would also like to detect dragging, you could use ontouchmove
which is fired every time you move your finger after touching the screen.
Solution 2:
You might be interested in onpointerup
and onpointerdown
events which will work on both touch and non touch devices. Check browser support