I know this question is old, but for the one's what are new, here is what you can do:
HTML
<img id="demo" src="myImage.png">
<button onclick="myFunction()">Click Me!</button>
JAVASCRIPT
function myFunction() {
document.getElementById('demo').src = "myImage.png";
}