What error in the following code would result in if(is1Pressed = true) console logging "1" repeatedly in console
if(is1Pressed = true){
console.log("1");
p.innerHTML = "<audio autoplay='autoplay' src='button1.wav'/>";
}
else if(is2Pressed = true) {
console.log=("2");
p.innerHTML = "<audio autoplay='autoplay' src='button1.wav'/>";
}
else if(is3Pressed = true) {
p.innerHTML = "<audio autoplay='autoplay' src='button1.wav'/>";
}
else if(is4Pressed = true) {
p.innerHTML = "<audio autoplay='autoplay' src='button1.wav'/>";
}
else if(is5Pressed = true) {
p.innerHTML = "<audio autoplay='autoplay' src='button1.wav'/>";
}
else
{
p.innerHTML = "<audio autoplay='autoplay' src='button1.wav'/>";
}
See Question&Answers more detail:os