JSFiddle - React, Tailwind, and code Playground

HTML

<html>
<body>
<div class="fruit">
<img id="apple_img" src="https://parade.com/.image/t_share/MTkwNTgxNDY1MzcxMTkxMTY0/different-types-of-apples-jpg.jpg" width="350" height="200">
</div>
</body>
</html>

JavaScript

var ARiframe = document.createElement("iframe");
ARiframe.style.height = 'auto';
ARiframe.style.width = 'auto';
const imgInDom = document.getElementById("apple_img");
imgInDom.parentNode.insertBefore(ARiframe, imgInDom);
ARiframe.contentDocument.body.appendChild(imgInDom);

imgInDom.onclick = function() {ARiframe.contentDocument.location.reload(true)};