JSFiddle - React, Tailwind, and code Playground
HTML
<div id="result" contenteditable="true"></div>
<button class="click">click to add text</butto>
CSS
#result {
border: 1px solid black;
width: 300px;
height:200px;
}
JavaScript
var result = $('#result');
$('.click').click(function () {
var preHtml = result.html();
result.html(preHtml + "hello");
result.focus();
});