DivMan,
для 0 ... 1 ... 2
<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");
input.oninput = function() {
console.log(input.value);
img.forEach(function(element, i) {
if (input.value.trim() && input.value == i) img[i].classList.remove("hidden");
else img[i].classList.add("hidden")
})
};
</script>
</body>
</html>