这在 Chrome 中有效,但在 IE 中无效。
HTML:
<img class="ortaresim" name="img1" src="Images/resim.png" alt="gezi" width="460" height="308" />
<a href="#" onMouseover="change_img()" onMouseout="change_back()"></a>
JavaScript:
function change_img() { document.images.img1.src = "Images/yemek.jpg"; }
function change_back() { document.images.img1.src = "Images/resim.png"; }