HTMLMediaElement.onerror

The onerror property of the HTMLMediaElement interface specifies an event listener function which will receive error events sent to the media element. These events occur when some form of error occurs while attempting to load or perform the media.

Syntax

HTMLMediaElement.onerror = EventListener;

Value

A function which serves as the event handler for the error event. When an error occurs, the specified function will be called. If null, no error handler is in effect.

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'onerror' in that specification.
Living Standard  

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support YesEdge Full support YesFirefox Full support 3.5IE Full support 9Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also

Document Tags and Contributors

Contributors to this page: fscholz, Sheppy
Last updated by: fscholz,