HTML/CSS/Basic Tags/bgsound

Материал из Web эксперт
Перейти к: навигация, поиск

"bgsound" plays a sound while the user visits the page

   <source lang="html4strict">
   

<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>
  Please use your own wav file to test the code.
  





<button type="button" onClick="stopSound()">Stop the music</button>
<button type="button" onClick="restartStop()">Restart the music</button>

</body> </html>


     </source>