Any number which is lesser than 0.4
will also be lesser than 0.65
. So, when the number is lesser than 0.4
, it compares against <= 0.65
, it is Truthy, so displays VOL-2
picture.
So, you just have to change the order of the conditions, like this
...
} else if (myVideo1.volume <= 0.4) {
bttnMuteUnmute.style.backgroundImage = "url(buttons-VOL-1.png)";
} else if (myVideo1.volume <= 0.65) {
bttnMuteUnmute.style.backgroundImage = "url(buttons-VOL-2.png)";
} else {
...