I Built A Smoother Age Picker Than a Dropdown (Pure HTML, CSS & JS)

Axolobit on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

AdvancedAccessibility17 min

About this video

This tutorial builds a vertical age selector in pure HTML, CSS and JavaScript as a dropdown alternative. It covers the markup, styling, tick animation and mouse, pointer and keyboard input, with a note on the slider role. It suits developers who want to build a custom form control.

What you’ll learn

  • Structure a custom age selector with semantic HTML and the ARIA slider role
  • Animate ruler ticks with easing and requestAnimationFrame in vanilla JavaScript
  • Handle mouse wheel, pointer drag and arrow-key input in a custom UI component