Playing Background Music

This Script allows the browser to play background music. Unfortulately, it works only in Internet Explorer.

The Script

<bgsound id="PlayMusic">
<script type="text/javascript">
<!--
PlayMusic.src="mj.mp3";
function OnOff() {
if (PlayMusic.src=="")
{
PlayMusic.src="mj.mp3";
OnOffButton.value="Stop";
} else {
PlayMusic.src="";
OnOffButton.value="Play";
}
}



[Back to Sample Scripts]