I am trying to show an image selected by the user from the list, but I do not see anything on the screen.
<!DOCTYPE html>
<html>
<body>
<style>
.container {
position: relative;
}
.center {
position: absolute;
left: 0;
top: 50%;
width: 100%;
text-align: center;
font-size: 18px;
}
img {
width: 100%;
height: auto;
opacity: 1;
}
</style>
<p>Images:</p>
<select id="ImSelect" size="6" onchange "getvalue()">
<option value="LB_1_000561">LB_1_000561</option>
<option value="LB_1_000562">LB_1_000562</option>
<option value="LB_1_000563">LB_1_000563</option>
<option value="LB_1_000564">LB_1_000564</option>
<option value="LB_1_000565">LB_1_000565</option>
<option value="LB_1_000566">LB_1_000566</option>
<option value="LB_1_000567">LB_1_000567</option>
<option value="LB_1_000568">LB_1_000568</option>
<option value="LB_1_000569">LB_1_000569</option>
</select>
<div class="container" id="x"></div>
<script>
function getvalue() {
var value_ = document.getElementById("ImSelect").value;
img.src = "Images/" + value_ + ".jpg";
var img = document.createElement("img");
var src = document.getElementById("x");
src.appendChild(img);
}
</script>
</body>
</html>