You can use the DOM "mouseover" event in the tag and attach a callback to it (then inside you change the image URL)
edit example code:
<div> <a id="myLink" href="#"> <img id="myImg" src="image.jpg" alt="" /> Here some caption </a> </div>
in js:
var img = document.getElementById('myImg'); document.getElementById('myLink').onmouseover = function(){
Then you will need to use onmouseout to return the original image.
source share