Javascript examples for DOM Event:Element Event Attribute
The onabort event occurs when the loading of an audio/video is aborted.
Bubbles | No |
---|---|
Cancelable | No |
Supported HTML tags: | <audio> and <video> |
The following code shows how to Execute a JavaScript when the loading of a video is aborted:
<!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>//from w w w . j a v a2 s.co m <script> document.getElementById("myAudio").onabort = function() {myFunction()}; function myFunction() { console.log("abort"); } </script> </body> </html>