OTP with Resend Timer
A verify form with a resend button that counts down before re-enabling.
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 text-center" style="max-width:320px"><div class="card-body">
<h6 class="fw-bold">Verify phone</h6>
<input class="form-control text-center mb-2" placeholder="Enter code" maxlength="6">
<button class="btn btn-primary w-100 mb-2">Verify</button>
<button class="btn btn-link btn-sm text-decoration-none" id="orBtn">Resend code</button>
</div></div>var btn=document.getElementById('orBtn');
btn.onclick=function(){var t=30;btn.disabled=true;var iv=setInterval(function(){btn.textContent='Resend in '+t+'s';t--;if(t<0){clearInterval(iv);btn.disabled=false;btn.textContent='Resend code'}},1000)};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.