function swapImg(imgId) {
var image = document.getElementById(imgId);
if (image.getAttribute("class") == "unselected") {
image.setAttribute("src", "img/frownie.gif");
console.log(image);
}
}
if i look at what’s outputted to console, the src of the image is correct. but it’s not changing in my browser. what’s up? (ie, the image stays the same even though the source url is changing…)
ugh i’m dumb. i accidentally wrote id instead of class in my code so there are multiple images with the same id, which meant i found the first one and swapped it and not the others. thanks for trying 🙁