Verify OTP

This is a simple OTP verification application built using CSS/JS/HTML

Today I learned multiple things :

  • Using element.focus() method to set focus on the first field
  • How to use media queries for style adjustment, flexbox for spatial alignments, CSS pseudoclass for selecting elements
  • Listening for keydown and backspaces event
  • Use forEach loop with focus() method to focus on a field
  • Using increment and decrement operators along with focus() method to handle indices with if condition
  • How to use setTimeout() method to delay operations for smooth user experience

File Info

Category HTML / JS / CSS
Credits 50 Projects in 50 days
Date January 26th, 2025
Codepen Click here