![]() |
The
onabort
event attribute in HTML defines a script to be executed when the loading of a media file is aborted. This event occurs specifically when the media data download is stopped, but not due to an error. |
It will Alert that the loading of a video has been aborted.
<script> // Dynamically set onabort event handler for an image document.getElementById("dynamicImage").onabort = function() { alert("Image loading aborted!"); };
</script>
<img id="dynamicImage" src="dynamic.jpg" alt="Dynamic Image">
The abort event occurs when the loading of an audio/video is aborted.
This event occurs when the media data download has been aborted, and not because of an error.
Tip: Related events that occurs when there is some kind of disturbance to the media loading process, are:
The numbers in the table specify the first browser version that fully supports the event.
<
element
onabort="
script
">
Value | Description |
---|---|
script | The script to be run on abort |
Supported HTML tags: | <audio> and <video> |
---|---|
Supported JavaScript objects: | Audio, Video |
html event attributes |
Type
: |
Develop |
Category
: |
Web Tutorial |
Sub Category
: |
HTML Media Events Attribute |
Uploaded by
: |
Admin |
Read Article https://horje.com/learn/1434/reference