Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Audio ended attribute

Audio ended attribute

Audio Object Reference Audio object

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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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 Reference Audio object