JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="input" />
<div>Превышен лимит на: <span id="count">0</span></div>
JavaScript
(function(max, count, input)
{
if (!count[0] && !input[0])
return -1;
var length = 0;
input.bind('input change', function(event)
{
length = this.value.match(/[а-яё]/g).length;
count.text(length > max ? length - max : 0);
});
}(10, $('#count'), $('#input')));