鼠标移动到图片上切换到另一张图片,移出时又切回来

HTML写法:

<img id="addLineImg" src="pages/annotator/claim/img/plus.png"
                             onmouseover="this.src='pages/annotator/claim/img/plus2.png';"
                             onmouseout="this.src='pages/annotator/claim/img/plus.png';"/>

JS写法:

    var img=document.createElement("img");
    img.setAttribute("src","pages/annottor/claim/img/trash.png");
    img.setAttribute("onclick","removeOneWorkitemLine(this);");
    img.setAttribute("onmouseover","this.src=\"pages/annottor/claim/img/trash2.png\";");
    img.setAttribute("onmouseout","this.src=\"pages/annottor/claim/img/trash.png\";");

 

posted @ 2016-07-13 17:59  逆火狂飙  阅读(4783)  评论(0编辑  收藏  举报
生当作人杰 死亦为鬼雄 至今思项羽 不肯过江东