标签:
function change(){
var photo = document.getElementById("photo");
var photoImg = document.getElementById("photoImg");
photoImg.src = photo.value;
}
<select name="photo" id="photo" onchange="change();">
<option value="images/1.gif" selected="selected">头像一</option>
<option value="images/2.gif">头像二</option>
</select>
<img id="photoImg" src="images/1.gif">
效果图:
标签:
原文地址:http://www.cnblogs.com/ganjun/p/5045021.html