Advertisement
izuemis

image plays & pauses music on click

Sep 9th, 2022
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. <script>
  2.  
  3. document.getElementById("image01").onclick = function() {
  4. var audio = document.getElementById("music");
  5. if (audio.paused) audio.play();
  6. else audio.pause();
  7. }
  8.  
  9. </script>
  10.  
  11. <audio id="music" src="https://cdn.discordapp.com/attachments/1011654612551487558/1012566905854382080/BanG_Dream_Venom_Full_Version_Covered_by_Afterglow_MV_fan_made_-_Romaji_Lyrics.mp3" preload="auto"></audio>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement