HTML DOM Audio loop properties
Definition and Usage
loop property sets or returns whether the audio should be played again at the end of play.
This property reflects the <audio> loop property.
When using this property, the audio continues to play after playing end.
Note: <audio> elements in HTML5 is new.
Browser Support
All major browsers support loop property.
Note: Internet Explorer 8 and earlier versions of IE does not support this property.
grammar
Back loop properties:
audioObject .loop
Set loop properties:
audioObject .loop=true|false
Property Value
值 | 描述 |
---|---|
true|false |
指示音频在结束时是否再次播放。
|
technical details
return value: | Boolean value that, if the audio loop returns true, otherwise returns false. |
---|---|
Defaults: | false |
More examples
Examples
Check whether the audio player to play again after:
var x = document.getElementById("myAudio").loop;
x The output is:
true
try it"
Related Pages
HTML Reference Manual: HTML <Audio> Loop Properties
Audio Object