Audio ended attribute
Example
Check whether audio playback has ended:
var x = document.getElementById("myAudio").ended;
x The output is:
true
Try it »
Definition and Usage
The ended attribute returns whether audio playback has ended.
If the playback position is at the end of the audio, the audio has ended.
Note: This attribute is read-only.
Browser support





All major browsers support the ended attribute.
Note: Internet Explorer 8 and earlier IE versions do not support this attribute.
Syntax
audioObject
.ended
Technical Details
| Return Value: | Boolean. Returns true if audio playback has ended, otherwise false. |
|---|
Audio object