JSFiddle - React, Tailwind, and code Playground
HTML
<textarea id="text" maxlength="500" rows="8" cols="50" placeholder="Type or paste text here..."></textarea>
<p><span id="count">0</span> / 500 characters</p>
JavaScript
const text = document.querySelector('#text');
const count = document.querySelector('#count');
text.addEventListener('input', () => {
count.textContent = text.value.length;
});