JSFiddle - React, Tailwind, and code Playground
HTML
Al perder foco el textarea te dirá la cantidad de caracteres
<textarea id="editor"></textarea>
JavaScript
function contarCaracteresDelTexto () {
var txt = document.getElementById('editor');
var div = document.createElement('div');
div.innerHTML = txt.value;
if(div.textContent) {
return div.textContent.length;
} else {
return div.innerText.length;
}
}
$('#editor').blur(function(){ alert(contarCaracteresDelTexto())});