``` --- ## Definition"> ``` --- ## Definition" />
Easy Tutorial
❮ Prop Tabledata Colspan Jsref Unescape ❯

onerror Event

Event Object

Example

Execute JavaScript when an error occurs during media data loading of a video:

<video onerror="myFunction()">

Definition and Usage

The onerror event is triggered when an error occurs during the loading of video/audio data.

Tip: Related events that affect media data loading include:


Browser Support

The numbers in the table specify the first browser version that fully supports the event.

Event Chrome IE Firefox Safari Opera
onerror Yes 9.0 Yes Yes Yes

Note: The onerror event is not supported in Internet Explorer 11 on Windows 7.


Syntax

In HTML:

In JavaScript:

In JavaScript, using the addEventListener() method:

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


Bubbles: No
Cancelable: No
--- ---
Event Type: Event
--- ---
Supported HTML Tags: <audio>, <video>
--- ---
❮ Prop Tabledata Colspan Jsref Unescape ❯