鼠标移动到图片上切换到另一张图片,移出时又切回来
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\";");