HTML onabort Attribute

❮ HTML Attributes


//Accessing the element
var vid = document.getElementById("myVideo");

//Creating a function
vid.onabort = function() {
    alert("The video load is aborted");


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

Standard Syntax

HTML: <element onabort="Script">

Browser Support


Applies to:

The onabort attribute can be used on the following element:

Element Attribute
<audio> onabort
<embed> onabort
<img> onabort
<object> onabort
<video> onabort

Attribute Values

Value Description
Script Specifies JavaScript.
❮ HTML Attributes