Check out example codes for "reset image tag js". It will help you in understanding the concepts better.

Code Example 1

<img id="myImg" src="compman.gif" width="107" height="98">

<button onclick="myFunction()">Try it</button>

<script>
  
function myFunction() {
  document.getElementById("myImg").src = "hackanm.gif";
}
</script>

Learn ReactJs, React Native from akashmittal.com