Live Profile Preview
Form inputs that live-update a profile card preview with initials.
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:400px"><div class="card-body">
<input class="form-control mb-2" id="lpName" placeholder="Your name" value="Jane Doe">
<input class="form-control mb-3" id="lpRole" placeholder="Your role" value="Designer">
<div class="border rounded p-3 text-center bg-light"><div class="rounded-circle bg-primary text-white d-grid mx-auto mb-2" style="width:50px;height:50px;place-items:center" id="lpAv">JD</div><div class="fw-bold" id="lpN">Jane Doe</div><div class="text-secondary small" id="lpR">Designer</div></div>
</div></div>var name=document.getElementById('lpName'),role=document.getElementById('lpRole');
function upd(){var n=name.value||'—';document.getElementById('lpN').textContent=n;document.getElementById('lpR').textContent=role.value||'—';document.getElementById('lpAv').textContent=n.split(' ').map(function(w){return w[0]||''}).join('').slice(0,2).toUpperCase()}
name.addEventListener('input',upd);role.addEventListener('input',upd);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.