My mute button isn't working

My mute button isn't working
0.0 0

#1

I’m trying to get my mute button to work, can anyone see what I’m doing wrong?

$(".audio").click(function() {
var audio = document.querySelector(".audio");
var currentState = audio.getAttribute(“class”);
$(“img”, this).toggleClass(“volumeOn volumeOff”);
if (currentState === “volumeOn”) {
soundSet.setAttribute(“volume(0.5)”);
soundRun.setAttribute(“volume(0.5)”);
soundFinish.setAttribute(“volume(0.5)”);
} else if (currentState === “volumeOff”) {
soundSet.setAttribute(“volume(0)”);
soundRun.setAttribute(“volume(0)”);
soundFinish.setAttribute(“volume(0)”);
}


#2

It’s working :slight_smile: