This page is Not Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

bgSound

Summary

The bgsound element (<bgsound>) instructs the browser to load and play a sound file while the user is on that page. Don’t use it. Use the audio element instead.

Overview Table

DOM Interface
HTMLBGSoundElement

Examples

If you want to use sound, please use the audio element:



<audio autoplay id="bgsound">
 <source src="http://media.w3.org/2010/07/bunny/04-Death_Becomes_Fur.mp4"
         type="audio/mp4">
 <source src="http://media.w3.org/2010/07/bunny/04-Death_Becomes_Fur.oga"
         type="audio/ogg; codecs=vorbis">
 <p>Your user agent does not support the HTML5 Audio element.</p>
</audio>
<button type="button"
        onclick="document.getElementById('bgsound').pause();">
  Stop background sound
</button>

Notes

Remarks

The <bgSound> element can appear anywhere within the document. This element is not rendered. This element does not require a closing tag. Do not use it! In HTML5 the <bgSound> is described as “non-conforming feature”.

Standards information

There are no standards that apply here.

HTML information

{

See also

Related articles

Audio

Attributions