Basically, I need to find a way to have a mute button for my website. I have an onclick sound for my menu options but I would like to have a mute button to prevent all audio being played after mute is pressed.
Thanks
Basically, I need to find a way to have a mute button for my website. I have an onclick sound for my menu options but I would like to have a mute button to prevent all audio being played after mute is pressed.
Thanks
Use this javascript for mute audio from website
<button onclick="muteAudio()">Mute audio</button>
function muteAudio(){
els=document.getElementsByTagName('audio');
for (var j = 0; j < els.length; j++) {
els[j].muted = true;
}
}