JSFiddle - React, Tailwind, and code Playground
HTML
<div style = "margin-top:100px; text-align:centre">
<img id="firstImg" src="http://www.smiley-faces.org/wallpaper/smiley-face-wallpaper-widescreen-001.jpg" alt="iRock" style="cursor:pointer" onclick="touchRock();" />
</div>
JavaScript
function touchRock(){
var userName = prompt ("what is your name?","Enter your name here.");
if(userName){
alert("It is good to meet you, " + userName + ".");
document.getElementById("firstImg").src="1.jpg";
}
}