<html> <body> <bgsound id="myBackgroundSound" src="yourmusic.wav" loop="1"> <script language="JavaScript"> function function1() { document.all.myBackgroundSound.loop = 2; } </script> <input type="button" value="Set the loop value to 2" onClick="function1();"> </body> </html>