<!DOCTYPE html>
<html lang="en-US">
<body>
<h2 ontouchcancel="myFunction()">Touch me</h2>
<script>
function myFunction(){
alert("Touch Cancelled");
}
</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>