Error trying to change src of image using javascript
TypeError: image1 is null
What's going on here? console.log returns "1" just fine, which is the name of the proper directory.
function changeImage(index) {
console.log(`${index+1}`);
var image1 = document.getElementById("img1");
image1.src = `images/${index+1}/1.png`;
}