Answers for "jquery Audio Play on button click"

1

jquery Audio Play on button click

$('.btn').click(function() {
  var audio = new Audio("sounds/" + $(this).attr('id') + ".mp3");
  audio.play();
});
Posted by: Guest on May-25-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language