Use of <bgsound> tag in HTML

html

Solution

It is a non-standard tag which instructs the browser to load and play a sound file (famously, at least in the mid-90's, a MIDI file) while the user is browsing your site.

Except in a few very special cases, the real purpose is to time how fast the user can find his browser's "close" or "back" button. Seriously, don't use it, on almost every site sound is unwelcome.

If you do decide to use it, you'll want to consider `marquee` and `blink` as well. Also an animated-GIF construction worker "under construction" sign and purple text on a dark green background.

If you want to give the user an option of playing music on your site (e.g., because its a music site), I suggest that a flash widget is your best bet. Depending on the site, it may or may not be appropriate to auto-play the music. Alternatively, you could use the new HTML5 audio element (though support is lacking).

update: As pointed out by Adam Brown, HTML5 audio is now supported almost everywhere and should be used instead of Flash.

Problem

What is the use of the `<bgsound>` tag in HTML?

Original source