JSFiddle - React, Tailwind, and code Playground
by nxjohny
HTML
<title>Test App</title>
<p>DANI APP </p>
<body>
<input id="mitteliungTextArea" type="text">
</body>
JavaScript
$(function(){
$("#mitteliungTextArea").keypress(function(e) {
var tval = $("#mitteliungTextArea").val(),
tlength = tval.length,
set = 10,
remain = parseInt(set - tlength);
if (remain <= 0 && e.which !== 0 && e.charCode !== 0) {
$('textarea').val((tval).substring(0, tlength - 1))
}
})
});