All posts

<input type="number">

Burhan BharmalShared reading

Just read a super useful breakdown of the HTML `` — surprisingly deeper than it looks. If you work with forms, this one’s worth the 5-minute read. �� https://olliewilliams.xyz/blog/guide-to-html-number-input/

Key takeaways:

• Set your min, max, and step — don’t leave validation to browser RNG.

• Use inputmode="numeric" or "decimal" for a better mobile keyboard experience.

• Feel free to ditch the default spinners and build cleaner custom controls.

• Use .valueAsNumber so you’re not wrestling with string parsing.

• Browser validation is mid — always layer your own checks.

Simple tweaks → massively better UX.