Easy Tutorial
❮ Prop Url Value Prop Fileupload Name ❯

Audio loop Attribute

Audio Object

Example

Set the audio to loop playback:


Definition and Usage

The loop attribute sets or returns whether the audio should start playing again when it finishes.

This attribute reflects the <audio> loop attribute.

When this attribute is used, the audio continues to play after it ends.

Note: The <audio> element is new in HTML5.


Browser Support

All major browsers support the loop attribute.

Note: Internet Explorer 8 and earlier versions do not support this attribute.


Syntax

Return the loop attribute:

Set the loop attribute:

Attribute Values

Value Description
true false Indicates whether the audio should replay at the end. true - Indicates the audio replays at the end.<br> false - Default. Indicates the audio does not replay at the end.

Technical Details

Return Value: Boolean, returns true if the audio loops, otherwise returns false.
Default Value: false
--- ---

More Examples

Example

Check if the audio replays after it finishes playing:


Related Pages

HTML Reference: HTML <audio> loop Attribute


❮ Prop Url Value Prop Fileupload Name ❯