You can give an html element an ID.
<img src="something.jpg" id="yourId">
Then look the object up using the ID.
var domElement = document.getElementById("yourId")
Now you have a reference to the dom element and you can interact with its properties...
domElement.src = "somethingnew.jpg";
That is pretty much all you need to do...