</> ConvertAtlas Developer Tools
Bootstrap 5 · Beginner

Password Match Check

Two password fields that validate they match live.

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:340px"><div class="card-body">
  <label class="form-label small fw-semibold">Password</label><input type="password" class="form-control mb-2" id="pmA">
  <label class="form-label small fw-semibold">Confirm</label><input type="password" class="form-control" id="pmB">
  <small id="pmMsg" class="d-block mt-1"></small>
</div></div>
var a=document.getElementById('pmA'),b=document.getElementById('pmB'),m=document.getElementById('pmMsg');
function check(){if(!b.value){m.textContent='';return}var ok=a.value===b.value;b.classList.toggle('is-valid',ok);b.classList.toggle('is-invalid',!ok);m.textContent=ok?'✓ Passwords match':'✕ Passwords do not match';m.className='d-block mt-1 small '+(ok?'text-success':'text-danger')}
a.addEventListener('input',check);b.addEventListener('input',check);
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.