0

This is my code so far, I mostly followed a tutorial using my own saved audio file and an image collected online.

<!DOCTYPE html>
<html>
  <head>
    <title>Image audio</title>
  </head>
  <body>
   <main>
      <div>
        <a onclick="playsong()" ondblclick="pausesong()">
            <img src="https://s7d2.scene7.com/is/image/TWCNews/rain_drops_streaksstockphotopng">
          </a>
      </div>
    </main>

    <script>
      var mysong = new Audio();
      mysong.src = 'RainwithBirds.mp3';

      const playsong = () =>{
          mysong.play();
      }
    </script>

  </body>
 </html>
4

0 回答 0