I tried to make one, but I always came up against some limitation. I think my logic will not work, but I still can not think of another one.
Javascript:
$(document).on("keydown", "#TxtObservacoes", function () {
var caracteresRestantes = 255;
var caracteresDigitados = parseInt($(this).val().length);
var caracteresRestantes = caracteresRestantes - caracteresDigitados;
$(".caracteres").text(caracteresRestantes);
});
HTML:
<span class="caracteres">255</span> Restantes <br>
<textarea id="TxtObservacoes"></textarea>
My code: link