<html>
<head>
<script>
function f1()
{
var obj1=document.getElementById("img1");
var obj2=document.getElementById("s1");
obj1.src=""+obj2.value;
}
</script>
</head>
<body>
<h1>Javascript Demo</h1>
<hr>
Select Image : <select id="s1">
<option>images (1).jpg</option>
<option>images (2).jpg</option>
<option>images (3).jpg</option>
<option>images (4).jpg</option>
</select>
<input type="button" value="Update Image" onclick="f1()"/><br><br><br><br>
<center>
<img id="img1" src="images (1).jpg" width="500" height="300" border="2"/>
</center>
</body>
</html>
<head>
<script>
function f1()
{
var obj1=document.getElementById("img1");
var obj2=document.getElementById("s1");
obj1.src=""+obj2.value;
}
</script>
</head>
<body>
<h1>Javascript Demo</h1>
<hr>
Select Image : <select id="s1">
<option>images (1).jpg</option>
<option>images (2).jpg</option>
<option>images (3).jpg</option>
<option>images (4).jpg</option>
</select>
<input type="button" value="Update Image" onclick="f1()"/><br><br><br><br>
<center>
<img id="img1" src="images (1).jpg" width="500" height="300" border="2"/>
</center>
</body>
</html>