Javascript DOM touchcancel Event via HTML Tag touchcancel attribute

Introduction

This example is for touch devices only.

View in separate window

<!DOCTYPE html>
<html>
<body>
<p ontouchcancel="myFunction()">
Touch this paragraph while you do something that will interrupt the event. </p>
<p id="demo"></p>

<script>
function myFunction() {/*from   ww w  . j a  va2  s  .  c o m*/
  document.getElementById("demo").innerHTML = "Touch Cancelled";
}
</script>

</body>
</html>
Bubbles: Yes
Cancelable: Yes
Event type: TouchEvent
Supported HTML tags: All HTML elements



PreviousNext

Related