JSFiddle - React, Tailwind, and code Playground

HTML

<body>
    <img id="1" onclick="verify(this)" src="http://placehold.it/100x100" />
</body>

JavaScript

function removetag_setother() {
    $("#1").remove();
    text = "<p>hello</p>";
    $("body").append(text);
}

removetag_setother();