if (order.notification == '0') {
soundClick();
}
function soundClick() {
var audio = new Audio(); // Create a new Audio element
audio.src = '/sms.mp3'; // Specify the path to the sound of "click"
audio.load();
audio.oncanplay = function() {
audio.play();
console.log("ok\r\n");
};
audio.autoplay = true; // autostart
}
Find more questions by tags JavaScript