Answer the question
In order to leave comments, you need to log in
addEventListener not working in Chrome?
Good afternoon dear Jedi of the web. Faced the following problem: There is a code
<button id="mute" title="Mute button" >
<div><img class="img-responsive" alt="Volume on button" src="img/main-body/btn_audio.png"></div>
</button>
document.getElementById("mute").addEventListener("click", function (evt) {
if (video.muted) {
video.muted = false;
evt.target.innerHTML = "<img alt='volume on button' src='img/main-body/btn_audio.png'>"
} else {
video.muted = true;
evt.target.innerHTML = "<img alt='volume off button' src='img/main-body/muted.png'>"
}
}, false);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question