试试 document.getElementById('img1').src

解决方案 »

  1.   

    document.img1.src == "dot_close.gif" 不建议这样用。
    document.img1.src.indexOf("dot_close.gif")>0
    你把alert(document.img1.src)打出来看看就明白了。用==判断的话,其实一直是false,所以没有任何的变化,造成你的误解
      

  2.   

    function menu_open()
    {
    if (document.all.img1.src == "dot_close.gif")
    {
    document.all.img1.src = "dot_open.gif";
    }
    else
    {
    document.all.img1.src = "dot_close.gif";
    }
    }
      

  3.   

    document.all.img1.src == "dot_close.gif" 
    还是再说一次,这样写不如这样写
    document.all.img1.src.indexOf("dot_close.gif")>0