HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <h2>Touch me</h2> <script> var x = document.getElementsByTagName("h2")[0]; function myFunction(){ alert("Touch Cancelled"); } x.addEventListener("touchcancel", myFunction); </script> <p><strong>Note</strong>: 'ontouchcancel' event is triggered when the touch event gets interrupted. (for example, too many touch points are created).<br>This example is only for touch devices.</p> </body> </html>
OUTPUT
×

Save as Private