JSFiddle - React, Tailwind, and code Playground

by interdream

HTML

<div id="test">I am a div. Click me to replace me with an image.</div>

JavaScript

$("#test").click(function() {
    $(this).replaceWith("<img src='http://dummyimage.com/100x100/000/fff&text=Example+image' />");
});