StealThis .dev

Verify Email

Email verification page with 6-digit OTP input, auto-advance focus, paste support, resend countdown, and success animation. No dependencies.

Open in Lab
css vanilla-js
Targets: JS HTML

Code

Verify Email

An email verification page with 6-digit OTP code input boxes, auto-advance focus between digits, paste support, backspace handling, resend timer, and an animated success state.

Features

  • 6 individual single-digit input boxes with outlined focus ring
  • Auto-advances focus to next box on digit entry
  • Backspace moves focus to previous box
  • Full paste support — pastes across all 6 boxes
  • Resend code link with 60-second countdown
  • Verify button activates when all 6 digits are filled
  • Animated success check with confetti burst on correct code
  • Error shake animation on wrong code

How it works

  1. Six <input maxlength="1"> boxes — keydown / input events manage focus navigation
  2. paste event listener splits clipboard text across boxes
  3. verify() checks a code (demo: 123456) and toggles success or error CSS class
  4. startCountdown() manages the resend timer with setInterval