JSFiddle - React, Tailwind, and code Playground

by Dekku

HTML

<div id="content" contenteditable="true"></div>
<button id="btnContent"> add</button>

CSS

#content{
    border: 1px solid black;
    width: 200px;
    height: 200px;
}

JavaScript

$('#btnContent').click(function(){
    $('#content').html("when &lt;b" + "<span class='spanPos'></span>");
});