function insert(selector, html, offset) {
var el = document.querySelector(selector);
var text = el.innerText;
el.innerHTML = text.slice(0, offset) + html + text.slice(offset);
}
insert('#text', '<span class="red">###</span>', 15);
<div id="text">0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ</div>
.red {
color: red;
}