JSFiddle - React, Tailwind, and code Playground
by Vengatesh rkv
HTML
<div id="text" contenteditable="true" ></div>
<div id="count"></div>
CSS
#text
{
width:137px;
position:relative;
height:100px;
background-color:white;
border:1px solid black;
color:black;}
#count
{
width:53px;
background-color:blue;
height:15px;
text-align:center;
color:white;
margin-left:40px;
}
JavaScript
$(document).ready(function(){
$('#text').keyup(function(){
var el=$(this);
$('#count').text(el.text().length);
});
});