play audio jquery code example
Example 1: how to play jquery audio
$('document').ready(function() {
const audio = new Audio("source.mp3" );
audio.play();
});
Example 2: jquery Audio Play on button click
$('.btn').click(function() {
var audio = new Audio("sounds/" + $(this).attr('id') + ".mp3");
audio.play();
});