HTML - attributes - onabort

revision:


Content

"onabort" attribute : defines script for when loading aborts syntax some examples

"onabort" attribute : defines script for when loading aborts

top

The onabort attribute defines a script to be run if the loading of the media file aborts.

This event occurs when the media data download has been aborted, and not because of an error.

The onabort attribute is part of the event attributes, and can be used on the following elements: <audio>, <embed>, <img>, <object>, <video>.

Events that occur when some disruption comes in the media loading process, are: onemptied, onerror, onstalled, onsuspend


syntax

top

<audio onabort="myScript"></ >

<embed onabort="myScript"></ >

<img onabort="myScript"></ >

<object onabort="myScript"></ >

<video onabort="myScript "></ >


some examples

top

HTML codes:

                <video style="margin-left:5vw;" id="myVideo" width="320" height="176" 
                    controls onabort="alert('Video load aborted')">
                        <source src="../../Wuzhen-20-10_02.mp4" type="video/mp4">
                    </video>