<video or audio onabort='eventHandler()'> - Javascript DOM Event

Javascript examples for DOM Event:onabort

Introduction

The onabort event occurs when the loading of an audio/video is aborted.

Summary

Bubbles No
Cancelable No
Supported HTML tags: <audio> and <video>

Execute a JavaScript when the loading of a video is aborted:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>


<audio id="myAudio" controls onabort="myFunction()">
  <source src="your.ogg" type="audio/ogg">
  <source src="your.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>//w ww .ja  v  a 2 s  . c  o  m

<script>
function myFunction() {
    console.log("abort");
}
</script>

</body>
</html>

Related Tutorials