'bgsound' Example : bgsound « HTML Tag Reference « HTML CSS Reference






'bgsound' Example

    
<html>
   <head>
      <title>bgsound element example</title>
      <bgsound src="yoursoundfile.wav" loop="3">
      <script language="javascript">
          function stopSound() {
               document.all.tags("bgsound")[0].volume = -10000; 
          } 
          function restartStop() {
               document.all.tags("bgsound")[0].volume = 0;
          } 
      </script>
   </head>
   <body>
   <button type="button" onClick="stopSound()">Stop the music</button>
   <br>
   <button type="button" onClick="restartStop()">Restart the music</button> 
</body>
</html>
           
      
      








Related examples in the same category

1.'bgsound' Syntax and Note
2.'bgsound' HTML Attributes
3.'bgsound' Event Handlers
4.'bgsound' CSS Attributes and JavaScript Style Properties
5.'bgsound' Microsoft Behaviors
6.'bgsound' JavaScript Properties
7.'bgsound' JavaScript Methods
8.'bgsound' JavaScript Collections