Latest web development tutorials

HTML DOM Audio ended property

Audio Object Reference Audio Object

Examples

Check if the audio playback ends:

var x = document.getElementById("myAudio").ended;

x The output is:

true

try it"

Definition and Usage

ended property returns whether the audio has ended.

If the playback position is located at the end of the audio, the audio has ended.

Note: This property is read-only attribute


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support ended property.

Note: Internet Explorer 8 and earlier versions of IE does not support this property.


grammar

audioObject .ended

technical details

return value: Boolean value that, if the audio playback ends, it returns true. Otherwise, it returns false.


Audio Object Reference Audio Object