DivMan,
<html>
<head>
<meta charset="utf-8">
<style>
.hidden {
display: none;
}
.img {
width: 200px;
height: 200px;
}
.img1 {background: green;}
.img2 {background: blue;}
.img3 {background: red;}
</style>
</head>
<body>
<input type="text" class="input">
<div class="img img1 hidden"></div>
<div class="img img2 hidden"></div>
<div class="img img3 hidden"></div>
<script>
var input = document.querySelector(".input");
var img = document.querySelectorAll(".img");
var arr = [];
img.forEach(function(el, i) {
arr.push(i)
});
console.log(arr);
input.oninput = function() {
console.log(input.value);
img.forEach(function(element, i) {
if (input.value - 1 == i) img[i].classList.remove("hidden");
else img[i].classList.add("hidden")
})
};
</script>
</body>
</html>