JSFiddle - React, Tailwind, and code Playground
HTML
<form>
<textarea id="send-txt" rows="2" cols="20">
</textarea>
</form>
JavaScript
$(document).ready( function() {
var maxLen = 10;
$('#send-txt').keypress(function(event){
var Length = $("#send-txt").val().length;
var AmountLeft = maxLen - Length;
$('#txt-length-left').html(AmountLeft);
if(Length >= maxLen){
if (event.which != 8) {
return false;
}
}
});
});