这是代码 - 它真的很基本,我想不出出了什么问题 当单击带有“onclick”代码的小图像时,它在 IE 中给出“对象不支持此属性或方法”错误。它在 Firefox 中运行良好!请帮忙!
<script language="javascript">
function showproduct1()
{
document.getelementbyid("productimg").src = "../images/productimg1.jpg";
}
function showproduct2()
{
document.getelementbyid("productimg").src = "../images/productimg2.jpg";
}
</script>
<a href="javascript:void(0)" title="Product 1">
<img src="../images/productimg1.jpg" style="height: 60px" onclick="showproduct1()" />
</a><br>
<a href="javascript:void(0)" title="Product 2">
<img src="../images/productimg2.jpg" style="height: 60px" onclick="showproduct2()" />
</a>
<a href="../images/productimg1.jpg" target="_blank" title="Click on Image to Expand">
<img src="../images/productimg1.jpg" width="210" border="0" alt="Product" id="productimg">
</a><br>
<br><small><strong>Click on images to expand</strong></small><p><strong>