var soundClick = (function () {
var audio = new Audio();
audio.src = 'http://freewavesamples.com/files/Yamaha-TG100-Ocarina-C5.wav';
return function () {
audio.play();
};
})();
<a href="" onclick="soundClick(); return false">Звук!</a>
function playSound(file)
{
if (file == undefined)
{
var file="/muzon.mp3";
}
chat.stopSound();
$
('<iframe src="' + file + '" class="d-none notify-sound" autoplay style="display:none;"></iframe>').appendTo('#infosmssound');
}
function stopSound()
{
$("#infosmssound .chat-notify").remove();
}
if (document.querySelector('скопированный селектор'))
{
тут выводи звук по js выше
}
function playSound(file)
{
if (file == undefined)
{
var file="/muzon.mp3";
}
chat.stopSound();
$
('<iframe src="' + file + '" class="d-none notify-sound" autoplay style="display:none;"></iframe>').appendTo('#infosmssound');
}
function stopSound()
{
$("#infosmssound .chat-notify").remove();
}
if (document.querySelector('скопированный селектор'))
{
тут выводи звук по js выше
}