Advertisement
dianakko

text that plays a song on click (for further questions ask in our cc ill try to solve it)

Sep 18th, 2021
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. NOTE: UR TEXT'S "ELEMENT NAME" GOES IN THE PART 'text02' u can change it if ur elemtns name is text05, text04 etc etc
  2.  
  3.  
  4. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css">
  5.  
  6. <script>
  7. document.getElementById('text02').addEventListener('click', function (e) {
  8. e.preventDefault();
  9. document.getElementById('audio').play();document.getElementById('text02').className = 'animate__animated animate__bounce';
  10. });
  11.  
  12. </script>
  13.  
  14. <audio id="audio" src="https://dl.dropbox.com/s/b1ddf5agfehsktx/Lyrics%29%20ft.%20Jhay%20Cortez.mp3"></audio>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement