Live Character Counter
A textarea with a live character counter that warns near the limit.
Requires Bootstrap 5. Add the CDN tags below to your page (styles in
<head>, scripts before </body>). The downloaded file already includes them.<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"><script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script><div class="card border-0 shadow-sm" style="max-width:360px"><div class="card-body">
<label class="form-label small fw-semibold">Bio</label>
<textarea class="form-control" id="ccArea" rows="3" maxlength="150" placeholder="Tell us about yourself…"></textarea>
<div class="d-flex justify-content-end"><small class="text-secondary" id="ccCount">0 / 150</small></div>
</div></div>var a=document.getElementById('ccArea'),c=document.getElementById('ccCount');
a.addEventListener('input',function(){c.textContent=a.value.length+' / 150';c.className=a.value.length>135?'text-danger':'text-secondary'});Free to use.This component uses Bootstrap 5 (linked above). Copy any file, or download a ready-to-open .html page with the CDN links already included.