Audio error attribute
Example
Get the error status of the audio:
var x = document.getElementById("myAudio").error.code;
Try it »
Definition and Usage
The error attribute returns a MediaError object.
The code attribute of the MediaError object contains the error status of the audio/video.
Note: This attribute is read-only.
Browser support





Currently only Internet Explorer supports the error attribute.
Note: Internet Explorer 8 and earlier IE versions do not support this attribute.
Syntax
audioObject
.error.code
Return Value
| Type | Description |
|---|---|
| Numeric value |
The code attribute of the MediaError object returns a numeric value indicating the error status of the audio: |
Audio object