A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/html/attributes/loop below:

loop ยท WebPlatform Docs

loop Summary

Sets or retrieves the number of times a sound or video clip will loop when activated.

## Examples

This example uses the loop property and the src property to change the number of times a background sound loops.

<SCRIPT>
function loopOnce() {
    oBGSound.loop = 1;
    oBGSound.src = oBGSound.src; 
}
function loopContinuously() {
    oBGSound.loop = -1;
    oBGSound.src = oBGSound.src; 
}
</SCRIPT>
:
<BGSOUND id="oBGSound" src="sound.wav">
<BUTTON onclick="loopOnce()">Loop Sound Once</BUTTON>
<BUTTON onclick="loopContinuously()">Loop Sound Continuously</BUTTON>

View live example

Notes Remarks

To restart a sound or video clip after changing its loop property, set the src property or dynsrc property to itself. For example:

oBGSound.src = oBGSound.src

The following are descriptions of how the loop property works for some boundary cases. {

Syntax See also Related pages Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4