Latest web development tutorials
 

onabort Event

< Event Object

Example

Execute a JavaScript if loading of an image is aborted:

<img src="image_w3default.gif" onabort="myFunction()">

Definition and Usage

The onabort event occurs when the user aborts the loading of an <img> or <input type="image"> element.


Browser Support

Event
onabort Not supported Yes Not supported Not supported Not supported

Syntax

In HTML:

<element onabort="myScript">

In JavaScript:

object.onabort=function(){myScript};

In JavaScript, using the addEventListener() method:

object.addEventListener("abort", myScript);

Note: The addEventListener() method is not supported in Internet Explorer 8 and earlier versions.


Technical Details

Bubbles: Yes
Cancelable: No
Event type: UIEvent if generated from a user interface, Event otherwise.
Supported HTML tags: <img> and <input type="image">
DOM Version: Level 2 Events

< Event Object