JSFiddle - React, Tailwind, and code Playground

HTML

<div id="txtarea" contenteditable="true">Some text</div>

JavaScript

var position = 5, txt = "moree ";
var current = $("#txtarea").html();
$("#txtarea").html([current.slice(0, position), txt, current.slice(position)].join(''));