JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test">
    Click to replace!
</div>

CSS

div {
    width:100px;
    height:100px;
    border:1px solid;
    cursor:pointer;
}

JavaScript

$("#test").click(function(){
    $(this).replaceWith('<b>12345</b>'); 
});