JSFiddle - React, Tailwind, and code Playground

HTML

<span class="file-wrapper" id="fileSpan">
    <input type="file" name="photo[]" id="photo" />
    <span class="button">Click to choose photo</span>
</span>
<div id="newDiv"></div>
<div id="div2">

</div>

CSS

#newDiv { border: 1px solid green; }
#div2 { margin-top:30px; border:1px solid blue; }

JavaScript

var photo = document.createElement("img");
photo.id  = "newId";
photo.src="https://www.google.ee/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png";
document.getElementById("newDiv").appendChild(photo); 
document.body.onclick=function() {
		document.getElementById("div2").appendChild(photo); 
}