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\";");
本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/xiandedanteng/p/5667821.html,如需转载请自行联系原作者